jot
Group: Members
Posts: 15
Joined: May 2006 |
|
Posted: May 22 2006,16:31 |
|
I've come up with something like this:
Code Sample | #!/bin/sh
url-'/http:///damnsmalllinux.org/static/act-Search&/CODE-02&/SID-4471bea06c252246'/ delikmiter='|'
wget "$url" -O - | grep "Topic Title" | sed 's/<!-- Begin Topic Entry [0-9]* -->/\n/g' | sed "s/linkthru[desc]*\">/> $delimiter /g" | sed "s/Profile[^>]*>\|highlight.>/> $delimiter /g" | see "s/<b>\([0-9]*\)<\/b>/ $delimiter \1/g" | sed '1d;s/Open Topic .*\|Last Post:/ /g' | sed 's/<[^>]*>//g' | sed 's/ */ /g' | head -4 | awk -F $delimiter '{print $2 "/" $3 "/" $4 "/" $5 "/" $6 "/" $7 "/" $8 "/" $9}'
exit 0
|
Replace the url with your own, I got mine like this: 1 log in to your account 2 click 'New Posts' 3 copy url from adress bar
Fields are separated by '|' delimiter 1 - blank (not used - it's a bug, I know ) 2 - topic title 3 - topic description 4 - forum 5 - topic starter 6 - replies 7 - views 8 - last post date 9 - last post author
Now, say you want to see just field 8,2,4 and 9 to achieve this change:
Code Sample | awk-F $delimiter '{print $2 "/" $3 "/" $4 "/" $5 "/" $6 "/" $7 "/" $8 "/" $9}' |
to
Code Sample | awk -F $delimiter '{print $8 "/" $2 "/" $4 "/" $9}' |
You can also adjust how many headlines are shown by changing 'head -4 |' to your liking, remember to add | at the end.
I know that this script is ugly and it is posible to shorten it, but it's just a 'quickie' . If someone could simplify this awk command, please do so.
And now the best part, You can save this script as .tor-dsl-for in ~ make it executable (chmod +x filename) and put something like this somwhere in your .torsmorc :
${color gray}DSL Forum:$color ${execi 1800 ~/.tor-dsl-for}
It'll update every 1800 seconds, that is half an hour, change it to your liking
And if you want to monitor current DSL version, you can use this in your .torsmorc (you can extract the part after pre_exec and save it as a script if you wish):
${color gray}DSL:$color Current version: ${pre_exec wget -q http://www.damnsmalllinux.org -O - | grep Curre | sed 's/<[^>]*>\|--.*\|,.*\|.*n //g' | head -1 } Current RC version: ${pre_exec wget -q http://www.damnsmalllinux.org -O - | grep Curre | sed 's/<[^>]*>\|--.*\|,.*\|.*n //g' | tail -1 }
It is executed every time before start of torsmo (pre_exec), if you wish it to update automatically change pre_exec to 'execi <interval>'
So this is the end my friend... Farewell
PS. The idea to put it in torsmo comes from a script for conky found somewhere on a site about conky , and rss on desktop idea comes from enlightenment PS2. I hope it works, I've checked it in a terminal only
|