Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $access_token = "tokenmu";
- $url = "https://graph.facebook.com/me/feed?method=POST";
- if(!empty($_GET['link']) && !empty($_GET['img'])){
- $link = $_GET['link'];
- $img = $_GET['img'];
- $cek = fopen("berita.txt",'r');
- $str = fgets($cek);
- fclose($cek);
- }
- $ch = curl_init();
- $attachment = array( 'access_token' => $access_token,
- 'link' => $link,
- 'picture' => $img,
- 'message' => 'Tukang Koran Facebook',
- 'name' => '',
- 'description' => '',
- 'from' => '',
- 'created_time' => '',
- );
- curl_setopt($ch, CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
- $result= curl_exec($ch);
- curl_close ($ch);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment