facebook - Forms and POST using perl -


i have supposed fill email form on http://faceoook.com/recover.php , know, can search email,name or phone number. trying search email, , content of page after search has been completed see whether profile found or not, code doesn't seem work.

use http::request::common; use lwp::useragent; $email="blabla\@hotmail.com"; %data=(email=>$email);  $user_agent = 'mozilla/6.0'; $browser = lwp::useragent->new; $browser->agent($user_agent); $ua=$browser->post('https://www.facebook.com/recover.php',\%data); if($ua->content=~/couldn\'t/){        #"couldn't" part of message displayed when                 print "not found";                    # input doesn't match } elsif ($ua->content=~/name/) { print "found"; } else { print "not found";  }  $result=$ua->content; open file,">","me.txt" or die $!; print file $result; close file; 

  • use strict
  • make compile under strict
  • review manpage lwp::useragent, there's problem code you'll have discover on own you'll remember
  • review variable names in light of conventions used in manpage
  • review approach (considering facebook has api, iirc)
  • no need escape single quote in regex

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -