从 Facebook 页面提取粉丝数据库

发布于 2024-10-01 05:26:22 字数 1479 浏览 11 评论 0原文

我正在尝试导出 Facebook 专页粉丝。

我发现的最接近的是这篇文章

它指出:

从 Facebook 页面获取粉丝是 Facebook API 尚未支持。 幸运的是,Facebook Web 界面 使用简单的 AJAX/JSON 调用来提供 您查看页面时的数据。您查看页面时的数据。

他这样解释他所做的事情:

我释放这些数据的策略是 嗅探网络流量 Wireshark工具,然后重播HTTP 使用 ruby​​ 脚本调用。使用 ruby​​ 脚本调用。

我对 ruby​​ 一无所知,所以我开始尝试在其中一条评论中留下 PHP 脚本,该脚本的作者是: "Etienne Bley"

脚本就像 这个

该脚本表示您可以下载 Charles Proxy 来查找此变量:

$cookie
$node_id
$post_form_id
$fb_dtsg

当我使用 Charles Proxy Soft 时,并登录作为管理员我得到这个: alt text

从那里我得到了我猜的 cookie 变量:

alt text

顺便说一句,共享整个 cookie 是否安全?有帮助吗? (如果是的话,我会尽快编辑)

脚本还说:

// 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 )

我无法理解他的意思:获取第二页

所以,我的问题:

1)这个变量是什么?

2)他们的价值观是什么?我应该/怎样才能得到它们?

3)正确设置这个脚本是我让这个脚本工作的唯一需要?

我希望问题足够清楚,如果还不清楚,请提出您需要的任何问题!

提前致谢!

I am trying to export Facebook Page Fans.

The closer I found was this article.

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 this.

The script says you can download Charles Proxy 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:
alt text

And from there I get what I guess is the cookie variable:

alt text

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

负佳期 2024-10-08 05:26:22

我不知道 Charles Proxy Soft,但我使用 Chrome 优秀的 Inspector 来跟踪请求。

步骤:

  1. 使用 Chrome 导航到您感兴趣的 Facebook 页面
  2. 打开检查器(Windows 上为 CTRL+Shift+J),转到“资源”选项卡并“启用资源跟踪”。
  3. 在 Facebook 页面上,点击页面左侧“粉丝”框中的“查看全部”。
  4. 滚动到粉丝列表的底部,然后单击“下一步”。
  5. 在“资源”选项卡中,您将收到一个对 /ajax/social_graph/fetch.php 的请求。单击它,在“标题”选项卡中您将看到您需要的内容。在我的例子中:
    Chrome Inspector

我确信您可以使用一百种不同的其他程序来做到这一点,我发现使用 Chrome 更容易,因为它已经在那里了:)

I don't know about Charles Proxy Soft, but I used Chrome's excellent Inspector to trace the request.

Steps:

  1. Use Chrome to navigate to the Facebook Page you're interested in
  2. Open up the Inspector (CTRL+Shift+J on Windows), go to the "Resources" tab and "Enable Resource Tracking".
  3. On the Facebook page, click "See all" in the Fans box on the left side of the page.
  4. Scroll to the bottom of the fan list, and click "Next"
  5. 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:
    Chrome Inspector

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 :)

掀纱窥君容 2024-10-08 05:26:22

好吧,看来这一切都很简单。我建议您获取一份 Fiddler 来亲自检查此计划。

我打开一个粉丝页面,查看粉丝,然后点击下一页。我看到了 http://www.facebook.com/ajax 的 POST 请求/social_graph/fetch.php?__a=1。我得到的是一个非常好的 JSON 数组,包含所有粉丝。

如果我们检查发布的变量,就会变得很明显......

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

无论如何,您感兴趣的是页面和限制。我敢打赌,如果你将页数设置为 0 并限制为 500 或其他什么,你就会得到你想要的东西。如果您无法可靠地更改限制,只需将其保留为 100 并继续递增页面即可。另外,我还有我的 cookie 和会话信息。我不知道你如何获得这些信息并从 PHP 发布信息,但我希望这能给你一些继续下去的机会。

再次,获取 Fiddler,检查浏览页面时会发生什么。

Alright, so it seems this is all simple. I recommend getting a copy of Fiddler 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 Fiddler, inspect what happens when you browse the page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文