· 7 years ago · Aug 22, 2018, 11:54 AM
1require "files-notifiche-twitter/twitteroauth/autoload.php";
2use AbrahamTwitterOAuthTwitterOAuth;
3
4
5// Do NOT Share (sono i token)
6define("CONSUMER_KEY", "xxx");
7define("CONSUMER_SECRET", "xxx");
8define("OAUTH_TOKEN", "xxx");
9define("OAUTH_SECRET", "xxx");
10
11// Post To Twitter
12$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_TOKEN, OAUTH_SECRET);
13$content = $connection->get('account/verify_credentials');
14$connection->post('statuses/update', array('status' => 'Test Alert');