List Info

Thread: authenticating to a website before getting data.




authenticating to a website before getting data.
country flaguser name
United States
2007-06-08 18:11:27

I am trying to write a script to get nike+ data. This data is located at a URL:

https://secure-nikeplus.nike.com/nikeplus/v1/services/app/run_list.jhtml

however, before you can access this URL and see the XML, you must first visit and
authenticate at this URL:

https://secure-nikeplus.nike.com/nikeplus/v1/services/widget/generate_pin.jhtml?
login=XXXXXXXXXXXX&password=XXXXXXX

I have the following setup in my perl script:

my $log_in = get("https://secure-nikeplus.nike.com/nikeplus/v1/services/widget/
generate_pin.jhtml?login=XXXXXXXXXXXX&password=XXXXXXX");
my $feed_xml = get("https://secure-nikeplus.nike.com/nikeplus/v1/services/app/
run_list.jhtml");
my $xml = new XML::Simple (KeyAttr=>[],NoAttr => 1);
my $xml_parser = $xml->XMLin($feed_xml);

however, it won't work. I'm guessing that perl can't login like that as being logged is
probably is a cookie set by the browser in most cases. Any ideas on how to get this to
work!?

Thanks!

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )