Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Superkaramba web page monitor? [script inside]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
Setras
n00b
n00b


Joined: 13 Apr 2004
Posts: 14
Location: The Multiverse... No, not that one. The one a bit to left and behind that big one... Yup, that's it

PostPosted: Fri Nov 26, 2004 12:35 pm    Post subject: Superkaramba web page monitor? [script inside] Reply with quote

G'day!

I was wondering if anyone has found a theme for Superkaramba that notifies the user when selected web pages are updated? I moved from GKrellM to Superkaramba and found a replacement for everything else but GKWebMon ( http://gkwebmon.sourceforge.net/ )...

Setras
_________________
That which is dreamed can never be lost, can never be undreamed.
-Master Li in Neil Gaiman's Sandman
Adopt a post!


Last edited by Setras on Sun Nov 28, 2004 11:24 am; edited 1 time in total
Back to top
View user's profile Send private message
Setras
n00b
n00b


Joined: 13 Apr 2004
Posts: 14
Location: The Multiverse... No, not that one. The one a bit to left and behind that big one... Yup, that's it

PostPosted: Sun Nov 28, 2004 10:21 am    Post subject: Reply with quote

Just incase anyone else happens to be interested, I didn't find anything already done for this, so I wrote a bash script to download the pages and check their md5sums and compare them to the md5sums from the last check. First bash script I ever wrote, so it's not pretty, but it seems to work. Even so, use at your own risk, I take no responsibility for any damages caused by the script.

Code:
#!/bin/bash
# A script to download selected webpages and by their md5sums determine if they have been updated.
# Remember to do 'mkdir -p ~/.webmon/pages', 'touch ~/.webmon/updated', touch ~/.webmon/new' and touch ~/.webmon/old' before running the script for the first time.
cd ~/.webmon/pages
rm  ../updated
touch ../updated
function work {
   wget -q -E $2
   if [ $? -eq 1 ]; then
      return
   fi
   for page in $(ls | grep .htm)
   do
      mv $page $1
      echo "$(md5sum $1)" >> ../new
      if [ "$(less ../new | grep $1)" != "$(less ../old | grep $1)" ]; then
         echo "$1" >> ../updated
      fi
   done
   rm $1
}
#Comics
work Inverloch http://inverloch.keenspace.com/volume2.html
work Timescape http://www.neondragonart.com/ts/main.php
work Phantom http://neondragonart.com/ptt/main.html
work Fallen http://aido.furvect.com/fall/fal-page.htm
work Order-of-Stick http://www.giantitp.com/cgi-bin/GiantITP/ootscript
rm ../old
mv ../new ../old
less -E ../updated

I placed the script in /usr/bin and then added

Code:
## module_webmon ##
<group> x=0 y=211 w=200 h=32
image x=0 y=0 path="image/bg-module.png"
text x=60 y=3 align="left" sensor=program program="webmon" interval=86400000
</group>

to my superkaramba system monitor. Just adjust the width, picture etc. to fit yours. The interval is set to 24 hours, so that it won't put a strain on the server holding each page.
_________________
That which is dreamed can never be lost, can never be undreamed.
-Master Li in Neil Gaiman's Sandman
Adopt a post!
Back to top
View user's profile Send private message
Slyde
Guru
Guru


Joined: 14 Jul 2003
Posts: 314

PostPosted: Sun Nov 28, 2004 11:16 am    Post subject: Reply with quote

Nice. I haven't heard of anything either. There was one for Konfabulator I thought...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum