Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * VirushLIB [Twitter]
- * @author Habib Bahruddin
- * @copyright VirushLIB
- **/
- ini_set('display_errors', 1);
- require_once('OAuth.php');
- $virushlogic = "VirushLIB#1"; // Abaikan Saja Yang Perlu Di Edit $username
- $username = "nabilahJKT48"; // Target Username
- $data = str_replace("VirushLIB", $username, $virushlogic);
- $x_data = explode("#", $data);
- // Buat APP Dulu Di https://dev.twitter.com/apps/
- $oauth = array(
- 'oauth_access_token' => "Isi Dengan TOKEN Kamu",
- 'oauth_access_token_secret' => "Isi Dengan TOKEN_SECRET Kamu",
- 'consumer_key' => "Isi Dengan Consumer Key Kamu",
- 'consumer_secret' => "Isi Dengan Consumer Secret Kamu"
- );
- $url = "https://api.twitter.com/1.1/statuses/user_timeline.json";
- $method = "GET";
- if (isset($_GET['user'])) {
- $user = $_GET['user'];
- }
- else {
- $user = $x_data[0];
- }
- if (isset($_GET['count'])) {
- $count = $_GET['count'];
- }
- else {
- $count = $x_data[1];
- }
- $get = "?screen_name=$user&count=$count";
- $new = new TwitterAPIExchange($oauth);
- $hasil = json_decode($new->setGetfield($get)
- ->buildOauth($url, $method)
- ->performRequest(),$assoc = TRUE);
- foreach($hasil as $tampil) {
- $tweet = $tampil['text'];
- $x_url = 'https://api.twitter.com/1.1/statuses/update.json';
- $x_method = 'POST';
- $eksekusi = array(
- 'status' => $tweet,
- );
- $x_new = new TwitterAPIExchange($oauth);
- $x_new->buildOauth($x_url, $x_method)
- ->setPostfields($eksekusi)
- ->performRequest();
- }
- echo "$tweet [<b><font color='lime'>DONE</font></b>]<br>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement