<?php /* * get_token.php * * @(#) $Id: get_token.php,v 1.1 2013/06/21 12:02:30 mlemos Exp $ * */
require('http.php'); require('oauth_client.php'); require('twitter_feed.php');
$twitter = new twitter_feed_class; $twitter->debug = false; $twitter->debug_http = true;
require('configuration.php');
if(strlen($twitter->consumer_key) == 0 || strlen($twitter->consumer_secret) == 0) die('Please go to Twitter Apps page https://dev.twitter.com/apps/new , '. 'create an application, and in the line '.$configuration_line.' of the file '. $configuration_file.' set the consumer_key to Consumer key and '. 'consumer_secret with Consumer secret. ');
if(($success = $twitter->Initialize())) { $success = $twitter->GetToken(); $success = $twitter->Finalize($success); } if($twitter->exit) exit; if($success) { $twitter->Output(); } else { Header('HTTP/1.1 503 Service Temporarily Unavailable'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Twitter Feed error</title> </head> <body> <h1>Twitter feed error</h1> <pre>Error: <?php echo HtmlSpecialChars($twitter->error); ?></pre> </body> </html> <?php } ?>
|