0

how can I make a php code for facebook to automatically update the cache of a single url I saw something similar in other threads, but did not manage to make it work:

Is there an API to force Facebook to scrape a page again?

Ask facebook to re-scrape URL

Tolch
  • 11
  • 2
    Hi and welcome to SO! The first link has a clear description of a POST request that would achieve this. What have you tried so far? What exactly do you mean by "did not manage to make it work". Please read https://stackoverflow.com/help/how-to-ask – reto Jun 21 '17 at 14:07
  • I answered below, because the characters did not reach me – Tolch Jun 21 '17 at 14:31
  • Please edit your question instead of adding these details as an answer. – reto Jun 21 '17 at 19:44

1 Answers1

0

For example use this php code, adding the url of my web www.tolchx.net, but it still appears the same GIF when I go to debugging:

<?php
   try {
      $params = [
         'id' => 'https://www.tolchx.net',
         'scrape' => 'true',
      ];
      $response = $fb->post('/', $params);
      print_r($response);
   } catch(\Facebook\Exceptions\FacebookResponseException $e) {
      // When Graph returns an error
      echo 'Graph returned an error: ' . $e->getMessage();
   } catch(\Facebook\Exceptions\FacebookSDKException $e) {
      // When validation fails or other local issues
      echo 'Facebook SDK returned an error: ' . $e->getMessage();
   }
?>

With that enough to automatically update the link cache www.tolchx.net?

thanks for the reply

Tolch
  • 11