<?php
/*
* get_search.php
*
* @(#) $Id: get_search.php,v 1.2 2013/06/21 12:46:36 mlemos Exp $
*
*/
require('http.php');
require('oauth_client.php');
require('xml_writer_class.php');
require('rss_writer_class.php');
require('twitter_feed.php');
$parameters = array(
'q'=>(IsSet($_GET['q']) ? $_GET['q'] : '"PHP Classes" OR phpclasses')
);
$twitter = new twitter_feed_class;
$twitter->debug = false;
$twitter->debug_http = true;
require('configuration.php');
if(strlen($twitter->access_token) == 0
|| strlen($twitter->access_token_secret) == 0)
die('Please access the get_token.php script and set the access_token'.
' and access_token_secret in the line '.$token_line.' of the '.
$token_file.' configuration script.');
if(($success = $twitter->Initialize()))
{
$success = $twitter->GetSearch('tweets', $parameters);
$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
}
?>
|