[Novalug] wget https request in a cron job - tracking Sprint Broadband card usage.

Miles D. Oliver miles.d.oliver@gmail.com
Thu Feb 25 10:55:09 EST 2010


A recent addition to our household is a Sprint Broadband card for my wife's
laptop.

With this card comes a 5GB monthly data cap, which she will be oblivious to
unless I make the effort to inform her of how much she has left on a
periodic basis.

Usage can be displayed for your account on Sprint.com from a URL after a
successful login.  If you try the URL without logging in you are pushed to
the Sprint login page and the results will be returned after you login.

The URL that works from Firefox, after a login is

https://manage.sprintpcs.com/Manage/myportal/!ut/p/c1/04_SB8K8xLLM9MSSzPy8xBz9CP0os3hPZ3fHQE8TIwMLY29TAyMfLxcDJwNjo8AQA6B8JE55_zADArrDQfbhVBHsYYZXHmw-SN4AB3A00PfzyM9N1S_IjTDIDEhXBACHtDT5/dl2/d1/L2dJQSEvUUt3QS9ZQnB3LzZfSUNHQVFJNDIwODNLNTAyTEpEMEIwMzJRTDI!/?selectedUsageMin=OURPHONENUMBER&forceAction=true&INTNAV=MU:PP:20090620:UsageDetails:DLSM

(OURPHONENUMBER substitued for our real number)

I'm trying to script this to capture the output and send her alerts when her
free bytes are getting low.

Ive successfully used wget to login get the cookie information and keep it
in a file. However when I attempt to get the results if the usage report I
fall short.

wget --post-data="Username=OURID&password=OURPASSWORD" --cookies=on
--keep-session-cookies --save-cookies=cookie.txt
https://sso.sprintpcs.com/sso/SignOn.do
wget --keep-session-cookies --load-cookies=cookie.txt
https://manage.sprintpcs.com/Manage/myportal/!ut/p/c1/04_SB8K8xLLM9MSSzPy8xBz9CP0os3hPZ3fHQE8TIwMLY29TAyMfLxcDJwNjo8AQA6B8JE55_zADArrDQfbhVBHsYYZXHmw-SN4AB3A00PfzyM9N1S_IjTDIDEhXBACHtDT5/dl2/d1/L2dJQSEvUUt3QS9ZQnB3LzZfSUNHQVFJNDIwODNLNTAyTEpEMEIwMzJRTDI!/?selectedUsageMin=OURPHONENUMBER&forceAction=true&INTNAV=MU:PP:20090620:UsageDetails:DLSM

The output of the 2nd wget is just a
https://sso.sprintpcs.com/sso/Login.do login
page so Im not keeping my session information.

Any thoughts on how to debug this https session with wget to get the results
Im looking for or point me to any debugging info?? my google queries are
falling short.

I've not used wget much other than to pull files.



-- 

Miles D. Oliver

Life's diversion......
http://picasaweb.google.com/miles.d.oliver/ModelAFord#
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.firemountain.net/pipermail/novalug/attachments/20100225/cff44c58/attachment.htm>


More information about the Novalug mailing list