views:

418

answers:

1

Hi,

I'm trying create a bot which automatically "likes" Facebook posts. Using Mechanize I can log into facebook, but unforunately the links to the like button are not understood by Mechanize - they seem to be obsfuscated by JS. The only links I see are the basics such as:

 <Mechanize::Page::Link
 "Edit friends"
 "http://www.facebook.com/friends/?ref=tn"&gt;
 <Mechanize::Page::Link "Developers" "http://developers.facebook.com/?ref=pf"&gt;
 <Mechanize::Page::Link "Careers" "/careers/?ref=pf">
 <Mechanize::Page::Link "Terms" "/terms.php?ref=pf">
 <Mechanize::Page::Link "Find friends" "/find-friends/?ref=pf">
 <Mechanize::Page::Link "Privacy" "/policy.php?ref=pf">
 <Mechanize::Page::Link "Mobile" "/mobile?ref=pf">
 <Mechanize::Page::Link "Help Centre" "/help/?ref=pf">

Anyone have any idea how I could get Mechanize to see the "like" links?

Thanks

+5  A: 

Why not try hitting the mobile version of the site. http://m.facebook.com. It looks like the Like links aren't using any JS there.

Travis
It worked. Nice lateral thinking! I would have hacked forever on the main site, where all it took was a visit to the mobile version. Good advice in general for screen scraping and bot difficulties.Cheers
Jack Kinsella
Glad it worked out for you.
Travis