Login   Register  
PHP Classes

File: get_search.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Manuel Lemos  >  PHP Twitter Feed  >  get_search.php  >  Download  
File: get_search.php
Role: Example script
Content type: text/plain
Description: Example script to output a RSS feed from results of searching tweets
Class: PHP Twitter Feed
Generate RSS feeds from timelines and searches
Author: By
Last change: Take parameters from the command line.
Date: 1 year ago
Size: 1,287 bytes


Class file image Download
 * get_search.php
 * @(#) $Id: get_search.php,v 1.2 2013/06/21 12:46:36 mlemos Exp $


$parameters = array(
'q'=>(IsSet($_GET['q']) ? $_GET['q'] : '"PHP Classes" OR phpclasses')

$twitter = new twitter_feed_class;
$twitter->debug false;
$twitter->debug_http true;


strlen($twitter->access_token) == 0
|| strlen($twitter->access_token_secret) == 0)
'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.');

$success $twitter->Initialize()))
$success $twitter->GetSearch('tweets'$parameters);
$success $twitter->Finalize($success);
Header('HTTP/1.1 503 Service Temporarily Unavailable');
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>Twitter Feed error</title>
<h1>Twitter feed error</h1>
<pre>Error: <?php echo HtmlSpecialChars($twitter->error); ?></pre>