PHP脚本到Curl Facebook Linter Url [英] PHP script to Curl Facebook Linter Url

查看:197
本文介绍了PHP脚本到Curl Facebook Linter Url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一个脚本php到curl的facebook linter URL,所以它迫使Facebook再次刮我的页面更新我的开放图形数据。

I have been looking for a script in php to Curl the facebook linter URL so it forces Facebook to scrape my page again to update my open graph data.

推荐答案

根据facebook的文档,你可以简单地使用linter api并传递 scrape = true 参数:

according to facebook's documentation you can simply do it by using the linter api and passing scrape=true parameter:

curl -X POST \
    -F "id={object-url OR object-id}" \
    -F "scrape=true" \
    "https://graph.facebook.com"

或使用php:

 $access_token="APP_ID|APP_SECRET"; //replace with your app details
 $params = array("id"=>'/*YOU PAGE URL*/',"scrape"=>"true","access_token"=>$access_token);
 $ch = curl_init("https://graph.facebook.com");
 curl_setopt_array($ch, array(
      CURLOPT_RETURNTRANSFER=>true,
      CURLOPT_SSL_VERIFYHOST=>false,
      CURLOPT_SSL_VERIFYPEER=>false,
      CURLOPT_POST=>true,
      CURLOPT_POSTFIELDS=>$params
 ));
 $result = curl_exec($ch);

此处

这篇关于PHP脚本到Curl Facebook Linter Url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆