diff -upr /Users/joe/temp/twitter_pull-6.x-dev/twitter_pull.class.inc twitter_pull/twitter_pull.class.inc --- /Users/joe/temp/twitter_pull-6.x-dev/twitter_pull.class.inc 2010-01-06 22:25:46.000000000 -0600 +++ twitter_pull/twitter_pull.class.inc 2010-03-19 13:56:00.000000000 -0500 @@ -60,17 +60,22 @@ class twitter_puller { function get_items() { - $prefix = substr($this->twitkey, 0, 1); - if ($prefix == "@") { - $url = 'http://twitter.com/statuses/user_timeline.json?screen_name='; - $key = substr($this->twitkey,1); // remove @ + $prefix = substr($this->twitkey, 0, 1); + $slash = strpos($this->twitkey, '/', 1); + // lists have the format @username/listname + if ($prefix == '@' && $slash !== FALSE) { + $username = substr($this->twitkey, 1, $slash - 1); + $listname = substr($this->twitkey, $slash + 1); + $url = 'http://api.twitter.com/1/'. urlencode($username) .'/lists/'. urlencode($listname) .'/statuses.json'; + } + else if ($prefix == "@") { + $key = substr($this->twitkey, 1); // remove @ + $url = 'http://twitter.com/statuses/user_timeline.json?screen_name='. urlencode($key); } else { - $url = 'http://search.twitter.com/search.json?q='; - $key = $this->twitkey; + $url = 'http://search.twitter.com/search.json?q='. urlencode($this->twitkey); } - $url = $url . urlencode($key); $ret = drupal_http_request($url); if ($ret->code < 200 || $ret->code > 399) {