Login   Register  
PHP Classes

File: get_statuses.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_statuses.php  >  Download  
File: get_statuses.php
Role: Example script
Content type: text/plain
Description: Example script to output a RSS feed from statuses of a given user
Class: PHP Twitter Feed
Generate RSS feeds from timelines and searches
Author: By
Last change: Made the type of statuses to retrieve be configurable.
Take parameters from the command line.
Date: 1 year ago
Size: 1,480 bytes


Class file image Download
 * get_statuses.php
 * @(#) $Id: get_statuses.php,v 1.3 2013/06/24 01:25:53 mlemos Exp $


     * Statuses may be mentions_timeline, user_timeline, home_timeline,
     * retweets_of_me
$statuses = (IsSet($_GET['statuses']) ? $_GET['statuses'] : 'user_timeline');
$parameters = array(
'screen_name'=>(IsSet($_GET['screen_name']) ? $_GET['screen_name'] : 'manuellemos')

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


strlen($twitter->consumer_key) == 0
|| strlen($twitter->consumer_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->GetStatuses($statuses$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>