-2

My old non-smart phone doesn't support GROUP facebook chat, so I was trying to find a way to scrape facebook GROUP messages and send them as text messages to the phone. I know some amount of Perl webscraping (HTML::TableExtract,WWW::Mechanize, LWP, the like) but I wasn't able to infiltrate facebook even when I provided my script my username and password.

Is there any way to get such a web scraper to work? Any APIs or toolkits I should look at? I'm not quite sure how to get started on this project. At worst, I could try to write a macro that copies text from certain locations on my browser....

edit: A cookie jar sounds like a good idea, I'll look into it. Here's a snippet of (bad) code.

        open(PERSONAL, "personal.txt");
        my @pers = <PERSONAL>;

        $ua -> get($cur_url);
        $ua -> form_id("login_form");
        chomp($pers[0]);
        $ua -> field("email", $pers[0]);
        chomp($pers[1]);
        $ua -> field("pass", $pers[1]);
        $ua -> click_button(value =>"Log In");

        $ua -> get("https://m.facebook.com/groups/170930939594231/");

        $ua -> save_content($dir."/group.html");
matthias krull
  • 4,389
  • 3
  • 34
  • 54
kyothine
  • 296
  • 2
  • 19
  • 1
    Perl www::mechanize should do the job if you know how to use it. Add a cookie jar and agent alias and you should be good to go. If you post some code as to what exactly you have tried we may be able to help. – user1092042 Jun 19 '12 at 13:04
  • 1
    Facebooks chat is just xmpp/jabber. WWW::Mechanize is the wrong tool for the task. – matthias krull Jun 19 '12 at 13:28

1 Answers1

4

Please use the xmpp API facebook provides. No need to scrape things.

matthias krull
  • 4,389
  • 3
  • 34
  • 54