Permalink
Browse files

Added "GET list subscriptions" api method

  • Loading branch information...
christospappas committed Nov 6, 2009
1 parent d076477 commit 2273c8a4e7c5d496922fc34551b46b22d30b68aa
Showing with 13 additions and 0 deletions.
  1. +4 −0 lib/twitter/base.rb
  2. +1 −0 test/fixtures/list_subscriptions.json
  3. +8 −0 test/twitter/base_test.rb
View
@@ -224,6 +224,10 @@ def list_subscribe(list_owner_username, slug)
def list_unsubscribe(list_owner_username, slug)
perform_delete("/#{list_owner_username}/#{slug}/subscribers.json")
end
+
+ def list_subscriptions(list_owner_username)
+ perform_get("/#{list_owner_username}/lists/subscriptions.json")
+ end
private
def perform_get(path, options={})
@@ -0,0 +1 @@
+{"lists":[{"mode":"public","uri":"/chriseppstein/sass-users","member_count":28,"slug":"sass-users","full_name":"@chriseppstein/sass-users","user":{"statuses_count":2102,"profile_link_color":"1F98C7","description":"Father, Software Engineer, Drinker of Beer","profile_background_tile":false,"geo_enabled":false,"profile_background_color":"C6E2EE","following":false,"verified":false,"profile_sidebar_fill_color":"DAECF4","followers_count":394,"time_zone":"Pacific Time (US & Canada)","profile_sidebar_border_color":"C6E2EE","url":null,"profile_image_url":"http://a1.twimg.com/profile_images/51769630/Photo_5_normal.jpg","created_at":"Fri Mar 14 17:33:06 +0000 2008","friends_count":106,"protected":false,"location":"San Jose, CA","screen_name":"chriseppstein","name":"Chris Eppstein","notifications":false,"favourites_count":80,"profile_text_color":"663B12","id":14148091,"profile_background_image_url":"http://s.twimg.com/a/1257191498/images/themes/theme2/bg.gif","utc_offset":-28800},"name":"sass-users","subscriber_count":8,"id":1680857}], "next_cursor":0, "previous_cursor":0 }
@@ -199,6 +199,14 @@ class BaseTest < Test::Unit::TestCase
user.screen_name.should == 'jnunemaker'
end
+ should "be able to view a members list subscriptions" do
+ stub_get('/pengwynn/lists/subscriptions.json', 'list_subscriptions.json')
+ subscriptions = @twitter.list_subscriptions('pengwynn').lists
+ subscriptions.size.should == 1
+ subscriptions.first.full_name.should == '@chriseppstein/sass-users'
+ subscriptions.first.slug.should == 'sass-users'
+ end
+
end

0 comments on commit 2273c8a

Please sign in to comment.