A server-side OAuth proxy for pulling a user's tweets and returning them as json.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
codebird @ 22f6356
.gitignore
.gitmodules
README.md
credentials.php.sample
get-tweets.php

README.md

php-twitter-proxy

A server-side OAuth proxy for pulling a user's tweets and returning them as json. Use in conjunction with ajax to display a user's Twitter feed on a website. Compatibile with Twitter API 1.1

Installation

PHP 5.3 and php5-curl are required

Copy the contents of credentials.php.sample to a new credentials.php file, and update with your API keys from Twitter.

Initialize the codebird submodule by executing

  • git submodule init
  • git submodule update

Parameters

The following GET parameters are accepted by the script.

  • screen_name - Twitter screen name (required)
  • count - Number of tweets to return (required)
  • exclude_replies - Whether to exclude @ replies. Accepted values 0 or 1. Default is 1 (optional)
  • include_rts - Whether to exclude retweets. Accepted values 0 or 1. Default is 1 (optional)

Output

The output is a json array of objects corresponding to each tweet. Each object has a tweet_html, tweet_text, and time parameter for the tweet itself (with links converted to anchor tags), raw tweet text, and relative time string respectively.