I have 16,000 URLs, I need to get the facebook graph ID of each one

心已入冬 提交于 2019-12-08 10:25:10

问题


I have 16,000 URLs. each is a Facebook open graph object. I need to get the open graph data for each of the 16k URLs.

The way I'm thinking about doing this is first finding the open graph object ID of each URL, and then in a nightly cron job, I would do a graph.facebook.com batch request for the details of each object.

However the first step I am unsure of how to do. How do I get all the Object IDs of 16,000 URLs? (all at once). perhaps FQL?

please help!


回答1:


If your URL looks like this:

http://www.facebook.com/WHATEVER

just do this:

https://graph.facebook.com/?ids=WHATEVER

... the object ID as well as a bunch of other info will be returned as the result. You can also request multiple objects as in:

https://graph.facebook.com/?ids=WHATEVER1,WHATEVER2,WHATEVER3

(test this out here: http://developers.facebook.com/tools/explorer/)




回答2:


$batched_request='[{"method":"POST","relative_url":"method/fql.query?query=select id, url from object_url where url in ('.$urls.')"}]';

$urls should be around 300 urls. and then repeat




回答3:


i dont think it be possible to get 16K url's information in a one action

you can set cron job for this & try to get information about 10 url every time



来源:https://stackoverflow.com/questions/9474037/i-have-16-000-urls-i-need-to-get-the-facebook-graph-id-of-each-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!