Extract fan database from Facebook page
-
I am trying to export Facebook Page Fans. The closer I found was http://adamloving.com/internet-programming/how-toexport-facebook-page-fans. It states: Getting fans from a Facebook page is not yet supported by the Facebook API. Luckily, the Facebook Web interface uses a simple AJAX/JSON call to supply the data when you view the page.the data when you view the page. And he explains what he does like this: My strategy to set this data free was to sniff the network traffic with the Wireshark tool, then replay the HTTP calls with a ruby script.calls with a ruby script. I don´t know anything about ruby so I started trying with a PHP scripts left in one of the comments, the one by: "Etienne Bley" The script goes like http://pastie.org/1284701. The script says you can download http://www.charlesproxy.com/ to find this variables: $cookie $node_id $post_form_id $fb_dtsg When I use the Charles Proxy Soft, and login to as administrator I get this: And from there I get what I guess is the cookie variable: BTW Is it safe to share the whole cookie?? is it helpful? (if it is I´ll edit asap) The script also says: // set settings in these 4 lines from results of charles when getting the 2nd page of "Get All Fans" in FB ( you need to be admin of fan page to do this ) I can´t understand what does he mean by: getting the 2nd page So, my questions: 1) What are this variables? 2) What are their values? How should/can I get them? 3) To have this scripts set correctly is the only thing I need for this script to work? I hope the question is clear enough, if not please ask any questions you need! Thanks in advance!
-
Answer:
I don't know about Charles Proxy Soft, but I used Chrome's excellent Inspector to trace the request. Steps: Use Chrome to navigate to the Facebook Page you're interested in Open up the Inspector (CTRL+Shift+J on Windows), go to the "Resources" tab and "Enable Resource Tracking". On the Facebook page, click "See all" in the Fans box on the left side of the page. Scroll to the bottom of the fan list, and click "Next" In the Resources tab, you'll have a request to /ajax/social_graph/fetch.php. Click on that, and in the Headers tab you'll see what you need. In my example: I'm sure you can do that with a hundred different other programs, I find it easier to use Chrome since it's already there :)
Trufa at Stack Overflow Visit the source
Other answers
Alright, so it seems this is all simple. I recommend getting a copy of http://www.fiddler2.com/fiddler2/ to inspect this plan yourself. I opened up a fan page, went to view the fans, and hit next page. I saw a POST request for http://www.facebook.com/ajax/social_graph/fetch.php?__a=1. What I got back was a really nice JSON array, containing all of the fans. If we inspect the variables posted, it becomes obvious... edge_type = fan page = 1 limit = 100 node_id = 123123123123123123123 (ID of the fan page I'm assuming) class = FanManager post_form_id = 97823498723498 (No idea, but I bet you can get this from the dialog) fb_dtsg = a1s3d5f (No idea) lsd = post_form_id_source = AsyncRequest Anyway, what you are interested in is page and limit. I bet if you set page to 0 and limit to 500 or whatever, you will get what you are looking for. In the event you can't change limit reliably, just leave it at 100 and keep incrementing page. Also, I have my cookies in there, with the session information. How you will get those and post from PHP I don't know, but I hope this gives you some things to go on. Again, get http://www.fiddler2.com/fiddler2/, inspect what happens when you browse the page.
Brad
Related Q & A:
- How to update facebook page wall from my site?Best solution by stackoverflow.com
- How to make a fan club in facebook?Best solution by Yahoo! Answers
- How to hide fan pages on facebook?Best solution by Yahoo! Answers
- There some fan pages on facebook that wont let me unlike it?Best solution by Yahoo! Answers
- How to unlike fan pages on facebook?
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.