Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

I can't pass Blogger.com authorization

by Gangabass (Vicar)
on Aug 16, 2007 at 10:48 UTC ( [id://632991]=perlquestion: print w/replies, xml ) Need Help??

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:

#!/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

Replies are listed 'Best First'.
Re: I can't pass Blogger.com authorization
by moritz (Cardinal) on Aug 16, 2007 at 10:54 UTC
    Did you switch off Javascript in your browser before logging in?

    Google sometimes loads parts of pages with javascript if it's enabled.

    Also I think you should try to solve your Net::Blogger problems instead of reinventing the wheel.

      Of course i'm disable JavaScript in browser before test so JavaScript is not the problem.

      Maybe you right (about Net::Blogger) but i can't realize "Why?".

      Why my script doesn't work... All parameters are exactly the same but...

Re: I can't pass Blogger.com authorization
by monkey_boy (Priest) on Aug 16, 2007 at 12:13 UTC
    I just hope thats not your real username and password in the posted script... doh!


    This is not a Signature...
      I think only good guyes visit Perlmonks :-)
        I'm afraid the GOOGLEbot visits perlmonks quite regularly.

        Website hackers have been using Google to trawl for vulnerabilities almost since its inception :(

        -David

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://632991]
Approved by FunkyMonk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-16 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found