Login   Register  
PHP Classes

File: get_token.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_token.php  >  Download  
File: get_token.php
Role: Example script
Content type: text/plain
Description: Example script to obtain access tokens for a user to access Twitter statuses
Class: PHP Twitter Feed
Generate RSS feeds from timelines and searches
Author: By
Last change:
Date: 1 year ago
Size: 1,183 bytes


Class file image Download
 * get_token.php
 * @(#) $Id: get_token.php,v 1.1 2013/06/21 12:02:30 mlemos Exp $


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


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

$success $twitter->Initialize()))
$success $twitter->GetToken();
$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>