GLADzTeguhID icon

Facebook Bot COPAS Berita

GLADzTeguhID | PRO | 10/26/16 01:18:02 PM UTC | 0 ⭐ | 404 👁️ | Never ⏰ | []
PHP |

1.78 KB

|

None

|

0 👍

/

0 👎

<?php 
 
function getFeed($feed_url) 
{
     $content = file_get_contents($feed_url);
     $su = new SimpleXmlElement($content);
 
$day = $su->channel->item; 
$link = $day->link;
$title = $day->title;
$asuw = $day->enclosure;
$des = $day->description.'<';
 
$toket = ('toket_semogg'); // Masukan Tosken mu . hapus file get c0ntent jika kamu menaruh langsung token nya
 
$pecah = explode('>',$des);
$pecahin = explode('<',$pecah[1]);
$bukak = $pecahin[0];
 
$judul = $title;
 
$url = "https://graph.facebook.com/me/feed?method=POST";
     $ch = curl_init();
 
    $attachment =  array(   'access_token'  => $toket,
            'link' => $link,
            'picture' => $asuw,
            'message' => $judul,
            '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);
 
 
print '
         <li>
<b>Simple bot berita</b> '.$title.' <br>
-> Contact me :
         <li>
           <a href="http://facebook.com/djempoler">On facebook</a>
         </li>';
 
}
$detik_inet = "http://rss.detik.com/index.php/inet";
$detik_sport = "http://rss.detik.com/index.php/sepakbola";
$detik_hot = "http://rss.detik.com/index.php/hot";
# $viva_tek = "http://rss.vivanews.com/get/teknologi";
$viva_bola = "http://rss.vivanews.com/get/bola";
$viva_all = "http://rss.vivanews.com/get/all";
 
$eyek = array($detik_inet,$detik_sport,$viva_all,$viva_bola);
$acak = $eyek[rand(0,count($eyek)-1)];
getFeed("".$acak."");
 
?>

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎