alexa-tracking

Main Content

1024
1024
KASKUS
51
244
https://www.kaskus.co.id/thread/52e1f9020d8b4621198b463b/membuat-twitterfeed-dengan-custom-domain-sendiri-menggunakan-php
Membuat twitterfeed dengan custom domain sendiri menggunakan PHP.
Spoiler for "Demo":

source code
korantwit.php
Code:
<?php
//marahmerah & agendosa was here
include('lastRSS.php');
require_once('twitteroauth.php');

define('CONSUMER_KEY', 'konsumer keymu');
define('CONSUMER_SECRET', 'konsumer secretmu');
define('ACCESS_TOKEN', 'akses tokenmu');
define('ACCESS_TOKEN_SECRET', 'aksestokensecretmu');
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);

$twitter->host = "https://api.twitter.com/1.1/";

$woconen=1;
while ($woconen>=0)
{

$internet = "http://rss.detik.com/index.php/inet";
$olahraga = "http://rss.detik.com/index.php/sepakbola";
$hot = "http://rss.detik.com/index.php/hot";
$politik = "http://rss.viva.co.id/get/politik";
$bola = "http://rss.viva.co.id/get/bola";
$nasional = "http://rss.viva.co.id/get/nasional";

$rot0 = array($nasional,$internet,$olahraga,$hot,$politik,$bola);
$feed = $rot0[rand(0,count($rot0)-1)];
$rss = new lastRSS;
if ($rs = $rss->get($feed)){
$title = $rs[items][$woconen][title];
$url = $rs[items][$woconen][link];
} else { die('Error:Raiso Moco RSS e Ndeng! '); }

$bitly_call = file_get_contents("http://api.bit.ly/shorten?version=2.0.1&longUrl=" . $url . "&login=isi-pake-loginmu&apiKey=isi-pake-apimu-sendiri&history=1");
$bitlyinfo=json_decode(utf8_encode($bitly_call),true);
$short= $bitlyinfo['results'][$url]['shortUrl'];

$title = str_replace("&", "and", $title);
$title = str_replace("<![CDATA[", " ", $title);
$title = str_replace("]]>", " ", $title);

$status = $title . " " . $short;

if (strlen($status)>140) {$status = substr($title,0,138-strlen($short)) . "... " . $short; }
echo $status;
$parameters = array('status' => $status);
$twitter->post('statuses/update',$parameters);

$woconen--;
}
?>


Bahan lain
lastRSS.php
twitteroauth.php
OAuth.php

Upload Jadi Satu Ke Hosting Kamu
Spoiler for "upload":


Tutorial

emoticon-I Love Indonesia (S)
boleh dong di coba gan,