Module: Tuiter::UserMethods
- Included in:
- Client
- Defined in:
- lib/tuiter/methods/user.rb
Instance Method Summary collapse
- #statuses_followers(options = {}) ⇒ Object
- #statuses_friends(options = {}) ⇒ Object
- #users_show(id) ⇒ Object
Instance Method Details
#statuses_followers(options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/tuiter/methods/user.rb', line 29 def statuses_followers( = {}) if [:id] query = "http://twitter.com/statuses/followers/#{[:id]}.json" else query = "http://twitter.com/statuses/followers.json" end if [:page] params = "?page=#{[:page]}" else params = "" end if res = @request_handler.get(query+params).body data = JSON.parse(res) return data.map { |d| Tuiter::User.new(d) } else return nil end end |
#statuses_friends(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/tuiter/methods/user.rb', line 10 def statuses_friends( = {}) if [:id] query = "http://twitter.com/statuses/friends/#{[:id]}.json" else query = "http://twitter.com/statuses/friends.json" end if [:page] params = "?page=#{[:page]}" else params = "" end if res = @request_handler.get(query+params).body data = JSON.parse(res) return data.map { |d| Tuiter::User.new(d) } else return nil end end |