So I went through this tutorial and set up a twitter widget that uses codebird.php and javascript to display a list of a twitter user's statuses, or a search term:
Easiest Way to Retrieve Twitter Timeline and Hashtags (Twitter OAuth API 1.1)
What I want to do now is edit it so that it will display statuses of a twitter list, such as:
https://twitter.com/13news/norfolk
I think I need to switch the "search" option below to "list"
search: '%23heroes2013', //leave this blank if you want to show user's tweet
user: 'quenesstestacc', //username
and also edit this section of code to take lists instead of search terms, but I'm not sure how.
// different JSON request {hash|user}
if (JQTWEET.search) {
request = {
q: JQTWEET.search,
count: JQTWEET.numTweets,
api: 'search_tweets'
}
} else {
request = {
q: JQTWEET.user,
count: JQTWEET.numTweets,
api: 'statuses_userTimeline'
}
}
Codebird's Readme file explains mapping Twitter API methods to Codebird's function calls like this:
For each slash in a Twitter API method, use an underscore in the Codebird function.
Example: statuses/update maps to Codebird::statuses_update().
For each underscore in a Twitter API method, use camelCase in the Codebird function.
Example: statuses/home_timeline maps to Codebird::statuses_homeTimeline().
For each parameter template in method, use UPPERCASE in the Codebird function. Also don’t forget to include the parameter in your parameter list.
Examples:
statuses/show/:id maps to Codebird::statuses_show_ID('id=12345'). users/profile_image/:screen_name maps to >Codebird::users_profileImage_SCREEN_NAME('screen_name=mynetx').<
However, I can't find how to map something like this:
lists/statuses.json?slug=teams&owner_screen_name=MLS&count=1
Any help would be greatly appreciated.
For the API call you mentioned, mapping should be as easy as this:
<?php
$cb->lists_statuses('slug=teams&owner_screen_name=MLS&count=1');
?>
Does it work?