Hi monks,
i can't realize why my simple sctipt can't pass blogger.com authorization (via Google).

Here is code:

#!/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="...">
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).

20070816 Janitored by Corion: Obscured login and password, as per Writeup Formatting Tips


In reply to I can't pass Blogger.com authorization by Gangabass

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.