-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
53 lines (41 loc) · 1.24 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
// code made by Fayçal
/////////////////////////// CONFIGURATION /////////////////////////////
// add your Twitter Developer credits
$APIkey="";
$APIsecretKey="";
$AccesToken="";
$AccesTokenSecret="";
// add Twitter name (@) of the account you want to copy tweets
$victim="";
// add your Twitter name (@)
$me="";
///////////////////////////////////////////////////////////////////
require "autoload.php";
use Abraham\TwitterOAuth\TwitterOAuth;
function getVictimsLastTweet(){
global $APIkey;
global $APIsecretKey;
global $AccesToken;
global $AccesTokenSecret;
global $victim;
global $me;
$twitter = new TwitterOAuth($APIkey, $APIsecretKey, $AccesToken, $AccesTokenSecret);
$tweets = $twitter->get("search/tweets", ["count" => 1, "q" => "from:".$victim." -RT", "result_type" => "recent", "exclude_replies" => true]);
foreach ($tweets as $tweet) {
foreach ($tweet as $text) {
return $text->text;
}
}
}
function main(){
global $APIkey;
global $APIsecretKey;
global $AccesToken;
global $AccesTokenSecret;
$twitter = new TwitterOAuth($APIkey,$APIsecretKey,$AccesToken,$AccesTokenSecret);
$victimsLastTweet=getVictimsLastTweet();
$twitter->post("statuses/update", ["status" => $victimsLastTweet]);
}
main();
?>