bash - Script to log on to website, check for changes and email if changed -
i'm hoping write simple script log on specific website (email username, no pw required) , check changes. if there changes i'd receive email notification stating there has been update. ideally script run often, maybe every 10 minutes.
since don't want have have laptop open occur thinking rasberry pi (always on , used xbmc) should running script in background.
i've seen lots of scripts check websites changes none of them fit senario of needing log in without password. furthermore, after establishing there has been change i'm not sure how sending email part work, have install email program on raspi? do/kind of know linux basics , how schedule script using cron.
so, there simple-ish script this? in advance!
edit:
the relevant part of login page is
<form accept-charset="utf-8" action="/booking/nanny_view/show" method="post"> <div style="margin:0;padding:0;display:inline"> <input name="utf8" type="hidden" value="✓" /> <input name="authenticity_token" type="hidden" value="zh92kur1rzahqpfrunrsb6y9qrwjoz46jnaao3xzova=" /> </div> <p> email address: <input id="search_email" name="search[email]" size="30" type="text" /> <input name="commit" type="submit" value="login" /> </p> </form>
starting script @ fixed times can done cron
.
posting mail address site should possible wget
:
wget --post-data='search[email]=me@foo.com' www.nanniesoncall.com/booking/nanny_view/show
(you might need send other fields, too. - "authenticity_token" might cause trouble. )
for parsing result page, maybe simple grep
enough.
for more sophisticated solution have @ mechanize
, library perl, python, , ruby, makes sending data , parsing results comfortable.
Comments
Post a Comment