Advertisement
cyber2friends

Facebook AutoFeed With Timeset By Cyber2friends

Sep 2nd, 2013
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.32 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.     Facebook AutoFeed With Timeset
  5. */
  6.  
  7. $access_token = ""; // Access Token
  8.  
  9. $post[] = array(
  10.     "msg" => "ทดสอบการส่ง", // ข้อความ
  11.     "to" => "100002713796328", // ส่งไปที่ Facebook ของใคร
  12.     "date" => "3/08/2013 00:00" // เวลาที่ต้องการส่ง
  13. );
  14.  
  15. /* เฉพาะโฮสผมเท่านั้น
  16. $delay = time()-2980;
  17. */
  18.  
  19. if(!isset($delay)) $delay = time();
  20. $now = date("d/m/Y H:i",$delay);
  21.  
  22. foreach($post as $array){
  23.     if($array["date"]==$now){
  24.         $list[] = array(
  25.             "msg" => $array["msg"],
  26.             "to" => $array["to"]
  27.         );
  28.     }
  29. }
  30.  
  31. if(isset($list) && count($list)!=0){
  32.     function curl_content($url){
  33.         $ch = curl_init();
  34.         curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)');
  35.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  36.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  37.         curl_setopt($ch, CURLOPT_URL, $url);
  38.         curl_setopt($ch, CURLOPT_REFERER, $url);
  39.         $result = curl_exec($ch);
  40.         curl_close($ch);
  41.         return $result;
  42.     }
  43.    
  44.     foreach($list as $array){
  45.         echo "Send (".$array["to"]."): ".curl_content("https://graph.facebook.com/".$array["to"]."/feed/?method=post&message=".urlencode($array["msg"])."&access_token=".$access_token)."<br>";
  46.     }
  47. }
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement