0

I am new in web development sector. It's seem to impossible to fetch my web pages using facebook Open Graph Object Debugger manually. When I search code to force re-scrape I found this code, but confused where to add. I thought it is php function and include , but it print parse error. Is it complete code ?, am I right ? Many website and blog advice to use following code. But I have no idea. I can't find clear way.

<?php   $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>
<?php curl "http://developers.facebook.com/tools/debug/og/object?q=$url"; ?>

1 Answer 1

1

This is what I'm using

   private function updateFacebookScrape($url){
        $ch = curl_init("http://developers.facebook.com/tools/debug/og/object?q=".$url);
        curl_setopt($ch, CURLOPT_HEADER, 0);
    
        curl_exec($ch);
        curl_close($ch);
    }

Also, make sure curl is installed on the server.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Tom for your response, I create php.ini file in public_html folder. I include code extension=php_curl.dll in this file. Then edit my page using your code but it display error. : Parse error: syntax error, unexpected private (T_PRIVATE) in /home/.. What's wrong ?
You aren't using it in a class so get rid of 'private'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.