I found one script for accessing app info from this forum.Basically, i am accessing facebook apps and may install it automatically.
I tried to see if i get a permission dialog page by following code but it does not return the permission page rather the first page.
what facebook do is multiple redirects or meta or sends few other request and then lands the user to permission page where i need to click allow button. But i am not able to get that final permission page for many apps. Here is the code,
use strict; use WWW::Mechanize; use HTTP::Cookies; my $url = "http://www.facebook.com"; my $appurl = "http://apps.facebook.com/funmoods/"; my $username = 'mail'; my $password = 'pass'; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get($url); $mech->form_name('menubar_login'); $mech->field(email => $username); $mech->field(pass => $password); $mech->click(); my $facebook_content = $mech->content(); # go to an app url $mech->get($appurl); my $app_content = $mech->content(); print "$app_content\n";
I don't know why mechanize does not access final loaded page. it took some time to load the permission page but mechanize always returns first source page. How i can tell mechanize to wait till it loads all the pages?
Need help thanksIn reply to Mechanize and Facebook App by ahelpyguy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |