Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Facebook AutoFeed With Timeset
- */
- $access_token = ""; // Access Token
- $post[] = array(
- "msg" => "ทดสอบการส่ง", // ข้อความ
- "to" => "100002713796328", // ส่งไปที่ Facebook ของใคร
- "date" => "3/08/2013 00:00" // เวลาที่ต้องการส่ง
- );
- /* เฉพาะโฮสผมเท่านั้น
- $delay = time()-2980;
- */
- if(!isset($delay)) $delay = time();
- $now = date("d/m/Y H:i",$delay);
- foreach($post as $array){
- if($array["date"]==$now){
- $list[] = array(
- "msg" => $array["msg"],
- "to" => $array["to"]
- );
- }
- }
- if(isset($list) && count($list)!=0){
- function curl_content($url){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_REFERER, $url);
- $result = curl_exec($ch);
- curl_close($ch);
- return $result;
- }
- foreach($list as $array){
- echo "Send (".$array["to"]."): ".curl_content("https://graph.facebook.com/".$array["to"]."/feed/?method=post&message=".urlencode($array["msg"])."&access_token=".$access_token)."<br>";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement