Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
 
 

Latest commit

 

History

124 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

twitter.php (extension to codebird-php)

For getting the last n tweets from a specific user's timeline.
(Can now automagically parse newlines and URLs!)

Dependencies:

Requires php5-curl and a valid Twitter application API key.

Usage:

require_once ('twitter.php'); 
// This code needs to be in the same directory as the 'twitter' folder!

$data = new get_tweets(1, 'kdude63', 'CONSUMER_KEY', 'CONSUMER_SECRET')->data();
echo $data[0]['text'];

This will return kdude63's latest tweet, and echo it onto the page.

data() or data(true) will return tweet data that is ready to be displayed on a page as HTML...
I.e - Turns URLs into links, newlines into line breaks, and makes the timestamp relative instead of absolute.

Just testing...<br>some stuff...<br>With a link: <a href="https://t.co/jZ5igXzcfk" target="_blank">https://t.co/jZ5igXzcfk</a>

While data(false) will return the raw data without doing anything to it.

Just testing...\nsome stuff...\nWith a link: https://t.co/jZ5igXzcfk

For more information on Codebird, see https://github.com/mynetx/codebird-php.

About

Get a user's latest tweet(s) in JSON format

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages