Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Monitor -> Email

Status
Not open for further replies.
Nov 9, 2005
4
US
Dilemma:
I need to receive notification via email when updates occur in regards to ISS sensors.

They are posted here.

I'm using wget to retrieve the file for local analysis.
wget -E -N -k
I experimented with
and can't seem to get the Perl module (Mail::Internet) to forward me the results.:(

Suggestions?:
<input comment here>

If further clarification is needed please respond accordingly.
BTW. Linux compatible...however win32 methods are welcomed.

Thanks,

- Justin

 
I'm not at all clear what you are wanting to achieve but it seems as if you are trying to monitor a web page for changes and send yourself email if you find any.

If I'm right, I'd be tempted to [heresy]use a shell script rather than perl[/heresy]. You could certainly do this in perl but it would be quicker to knock up something like
Code:
#!/usr/bin/[red]sh[/red]

SAVE=/var/spool/monitor   # our copy of the last version of the page
TEMP=/tmp/monitor.$$      # local copy of the current version
MAIL=me@mydomain.net      # address to notify of changes
PAGE=[URL unfurl="true"]http://www.iss.net/db_data/xpu/RSNS.php[/URL]

wget -O $TEMP $PAGE

LAST=`sum $SAVE`
THIS=`sum $TEMP`

if [ "$LAST" != "$THIS" ] ; then
  diff $SAVE $TEMP | mail -s 'Page has changed' $MAIL
fi

rm $SAVE
mv $TEMP $SAVE

Does that get you anywhere near?

Yours,

fish



[&quot;]As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.[&quot;]
--Maur
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top