简体   繁体   English

如何使用Linux脚本检测Facebook页面是否未发布

[英]How to detect if Facebook page is unpublished using Linux script

I've created many business/company pages in Facebook. 我在Facebook中创建了许多业务/公司页面。 But regularly Facebook unpublishes them. 但是定期Facebook不会发布它们。

I'd like to check whether a page is unpublished using some script on Linux which can notify me. 我想使用Linux上可以通知我的脚本检查页面是否未发布。

How can I do it? 我该怎么做?

There is related thread: Facebook API: Determine if Facebook Page is published / unpublished and curl command mentioned does not seem to be working correctly when I tried on my Linux command prompt. 有一个相关的线程: Facebook API:确定在我的Linux命令提示符下尝试时, Facebook Page是否已发布/未发布,并且提到的curl命令似乎无法正常工作。

First of all, you'll need a User Access Token with manage_pages permission. 首先,您需要一个具有manage_pages权限的用户访问令牌。 Then, you should be able to do the following: 然后,您应该能够执行以下操作:

 curl -4 "https://graph.facebook.com/fql?q=SELECT%20page_id%2C%20name%2C%20username%2C%20is_published%20FROM%20page%20WHERE%20page_id%20IN%20(SELECT%20page_id%20FROM%20page_admin%20WHERE%20uid%20%3D%20me())%20AND%20is_published%3D0%20ORDER%20BY%20fan_count%20DESC&access_token={user_access_token}"

and replace {user_access_token} with your actual User Access Token. 并将{user_access_token}替换为您的实际用户访问令牌。

Call https://graph.facebook.com/PAGE_ID and check, if a "Unsupported get request" is returned. 调用https://graph.facebook.com/PAGE_ID并检查是否返回了“不支持的获取请求”。 If yes, then it can be, that the page is unpublished. 如果是,则可能是该页面未发布。

This attempt is not going to work for age-restricted pages! 此尝试不适用于有年龄限制的页面! They always return "Unsupported get request" when calling the Graph API endpoint with no access token. 当调用没有访问令牌的Graph API端点时,它们总是返回“不支持的获取请求”。

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

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