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

Jeff Stoner leapfrog at freeshell.org
Thu Feb 25 13:21:13 EST 2010


On Thu, 25 Feb 2010, Miles D. Oliver wrote:

> 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.

Are you putting single quotes around the URL? If you don't, the shell will 
parse it and do it's voodoo. The '!', ':', '?' and '&' have special 
meaning to the shell.

> 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.

I'm a big fan of using Perl and LWP for such things.

--Jeff

"You cannot unsay a cruel word." - Unknown




More information about the Novalug mailing list