Gangabass has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks,
i can't realize why my simple sctipt can't pass blogger.com authorization (via Google).
Here is code:
Can you show me why i get different pages in browser and in script? I have try to send exactly same headers but that doesn't help :-( Also, i try Net::Blogger (i need to post message in blog) but it doesn't work (bad blog ID error).#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $ua_blogger = LWP::UserAgent->new; $ua_blogger->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv +:1.8) Gecko/20051111 Firefox/1.5"); my $login = 'myusername'; my $pass = 'secret'; #going to main page and recieving cookies from Blogger #and Google page address in HTML iframe element my $request = HTTP::Request->new( GET => "https://www.blogger.com/star +t" ); my $response = $ua_blogger->request($request); my ($google_url) = $response->content =~ m{<iframe src="(.+?)"}; #getting cookies from Google and main auth form $request = HTTP::Request->new( GET => $google_url ); $request->header('Referer' => 'https://www.blogger.com/start'); $response = $ua_blogger->request($request); #but at this point i recieve wrong page: #1. The page has different title # a) in browser it's "Blogger Login Frame" # b) script recive "Google Accounts" #2. and it's missing very significance form elements # a) normal form # b) some fields are missing (e.g. <input type="hidden" name="conti +nue" value="...">
20070816 Janitored by Corion: Obscured login and password, as per Writeup Formatting Tips
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I can't pass Blogger.com authorization
by moritz (Cardinal) on Aug 16, 2007 at 10:54 UTC | |
by Gangabass (Vicar) on Aug 16, 2007 at 12:41 UTC | |
|
Re: I can't pass Blogger.com authorization
by monkey_boy (Priest) on Aug 16, 2007 at 12:13 UTC | |
by Gangabass (Vicar) on Aug 16, 2007 at 12:43 UTC | |
by erroneousBollock (Curate) on Aug 16, 2007 at 17:34 UTC |