简体   繁体   English

仅在Facebook所有公共帖子中搜索使用Graph API或FQL链接的帖子?

[英]Searching Facebook all public posts only for posts with links using Graph API or FQL?

Is it possible to search Facebook all public posts only for posts with links using the Graph API or FQL? 是否可以仅使用Graph API或FQL在Facebook所有公共帖子中搜索带有链接的帖子?

I tried a bit with https://graph.facebook.com/search?q=watermelon&type=post but couldn't figure it out... 我用https://graph.facebook.com/search?q=watermelon&type=post尝试了一下,但无法弄清楚...

This query comes close: 该查询接近:

https://graph.facebook.com/search?q=http:&type=post&fields=link

the "q" param says "only return posts whose message contains the string 'http:'", which gives a good first cut, but still lets some through without real links. “ q”参数表示“仅返回其邮件包含字符串'http:'的帖子”,这虽然可以很好地进行首切,但仍然可以通过某些链接而没有真正的链接。 You can then walk through the response and throw away any results that don't contain a 'link' field. 然后,您可以浏览响应,并丢弃任何不包含“链接”字段的结果。 If all you care about is the link itself, then "fields=link" says "only return the id, created_at, and link fields," and makes the query go a bit faster. 如果您只关心链接本身,那么“ fields = link”将显示“仅返回id,created_at和link字段”,并使查询执行得更快。

Looking it over, it appears that certain URLs do not turn into links -- eg bit.ly URLs. 仔细一看,似乎某些URL不会变成链接-例如bit.ly URL。 So maybe you want to get the message and parse it yourself, eg 因此,也许您想获取消息并自己解析,例如

https://graph.facebook.com/search?q=http:&type=post&fields=link,message

You may also want to do a search on 'https:' to get those URLs as well. 您可能还想在“ https:”上进行搜索,以获取这些URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM