Thanks a lot digitallife!
Works great. But when there is no content between <zeile2> and </zeile2>
It doesn't remove those two xml tags.
I have no idea why...
sed -E 's/\<.+>(.[COLOR="Red"]*[/COLOR])\<\/.+>/\1/'
I know there is already a way to get facebook notifications. Here is my version that skips the use of automator.
$ curl "http://your url here" -A "Mozilla/4.0" | grep 'title' | egrep '(commented|your Wall)' | sed -e 's/\<title\>//' -e 's/\<\/title\>//' -e "s/\&apos\;/'/" -e 's/ //' | head -n 4
The url you must have to use this can be obtained by clicking the notifications button on the lower right hand corner of any facebook page. From there click on show all. This should send you to a new page. Click the link for "Your notifications" on the right side of the screen. Now this should send you to a new page. Copy the url and paste that into your url here. To change the number of notifications shown change the last number in the code. It is currently set to show 4.
You must replace feed:// (from the facebook url) with http:// otherwise this will not work.
That should work to show facebook notifications if not write back and I'll try my best to help troubleshoot.
Hi,
yeah it's "obvious":
replace the last part with:
Code:sed -E 's/\<.+>(.[COLOR="Red"]*[/COLOR])\<\/.+>/\1/'
The + mean "one or more" the * means "zero or more"![]()
thanks man.... are those regular expressions?
Now I gotta figure out how to make the headlines bold...
curl https://www.rz.fh-hannover.de/etech/schoof/meldungen/export/meldungen.xml | grep -E '(ueberschrift|zeile)' | sed -E 's/\<zeile/ &/1' | sed -E 's/\<ueberschrift>(.+)\<\/ueberschrift>/[COLOR="Magenta"]^[[/COLOR][1m\1[COLOR="Magenta"]^[[/COLOR][0m/' |sed -E 's/\<.+>(.+)\<\/.+>/\1/'
Been going thru all the excellent scripts here and deciding which ones I would like to try to get my feet under me before I start work on some of my own. One question for this n00b though .... When one makes their geeklets, do they all go under the "default group" or should one create a group of each geeklet you write or a group for each type of geeklet?
Thanks. Do you mean a group for shell geeklets, a group for file geeklets, and a group for image geeklets? Or something else instead - like a group for date/calendar geeklets, a group for AppleScript geeklets, etc...?
Thanks.
Scott
# prev month
cal -m $(date -v-1m +%b)
#next month
cal -m $(date -v+1m +%b)
#Month after next
cal -m $(date -v+2m +%b)
Can someone look at my multiple calenders code and see why I'm repeating January 2009 instead of displaying January 2010. Just noticed this when November hit. Thanks for the help
And my Desktop running the cal.Code:# prev month cal -m $(date -v-1m +%b) #next month cal -m $(date -v+1m +%b) #Month after next cal -m $(date -v+2m +%b)
![]()
Hi,
yes sed uses regular expressions.
To learn about sed and regular expressions check a post of mine 1 or 2 pages back.
Regarding bold a can say the ANSI code for it is [1m.
Check another post of mine also a couple pages back regarding the usage of ANSI color codes.
So you should get to a result like this:
Please note that the '^[' is only 1 character and has to be typed in a special way (refer to my post on ANSI colors)Code:curl https://www.rz.fh-hannover.de/etech/schoof/meldungen/export/meldungen.xml | grep -E '(ueberschrift|zeile)' | sed -E 's/\<zeile/ &/1' | sed -E 's/\<ueberschrift>(.+)\<\/ueberschrift>/[COLOR="Magenta"]^[[/COLOR][1m\1[COLOR="Magenta"]^[[/COLOR][0m/' |sed -E 's/\<.+>(.+)\<\/.+>/\1/'
Great, thanks a lot!
But I just can't figure out how to type the Escapecharacter into NerdTool. I can use them in the terminal, but when I copy and paste it into Nerdtool, it becomes two characters :-(
I s there another ways excpet for STRG+v and then ESC?
Sory, for asking this, but I did not get it from your previous post :-/
it's supposed to support ANSI ESC characters.
But the only way I get one of those is in the terminal via strg+v and ESC. When i move the cursor in the terminal line, it's recognized as one character, but when i select it with the mouse it's two characters. And that's how it gets pasted into Textedit.app when I try to write a shell script. Or Nerdtool, when I try to set it as shell command.... always two characters. Is there any other way to print these?
I always end up having printed the two characters:
![]()
echo "curl https://www.rz.fh-hannover.de/etech/schoof/meldungen/export/meldungen.xml | grep -E '(ueberschrift|zeile)' | sed -E 's/\<zeile/ &/1' | sed -E 's/\<ueberschrift>(.+)\<\/ueberschrift>/^[[1m\1^[[0m/' |sed -E 's/\<.+>(.*)\<\/.+>/\1/'" > news3.sh
okay, no I tried using:
Code:echo "curl https://www.rz.fh-hannover.de/etech/schoof/meldungen/export/meldungen.xml | grep -E '(ueberschrift|zeile)' | sed -E 's/\<zeile/ &/1' | sed -E 's/\<ueberschrift>(.+)\<\/ueberschrift>/^[[1m\1^[[0m/' |sed -E 's/\<.+>(.*)\<\/.+>/\1/'" > news3.sh
I replaced the "two characters" with the escape character, then hit enter to write the file....
doesnt work. Nerdtool prints [1m and [0m
:-(
it definately says so in this description: http://www.macupdate.com/info.php/id/31909
But I also tested it in geektool 2.1.2
No bold...
as for "cat news3.sh".... I see '/1' in bold.....
I'm freakin' out =)
okay, I am trying geektool 3 RC5 right now....
But is there a trick? when i try to run a shell command like curl, I dont get any output. Little snitch says geektool transfers data, but I don't see anything in the grey frame.
A command like "echo test" works fine....
maybe because it's a release candidate?
It gives me the whole year for 2010 instead of just January 2010.Hi,
that happens because the "date -v-2m +%b" returns the month (january). Since you don't specify the year, it assumes it's the current year,therefore you get January 2009.
Instead of
date -v+2m +%b
use
date -v+2m "+%b %Y"
It should work (didn't test it)