Module: Tuiter::UserMethods

Included in:
Client
Defined in:
lib/tuiter/methods/user.rb

Instance Method Summary collapse

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(options = {})
  if options[:id]
    query = "http://twitter.com/statuses/followers/#{options[:id]}.json"
  else
    query = "http://twitter.com/statuses/followers.json"
  end
  if options[:page]
    params = "?page=#{options[: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(options = {})
  if options[:id]
    query = "http://twitter.com/statuses/friends/#{options[:id]}.json"
  else
    query = "http://twitter.com/statuses/friends.json"
  end
  if options[:page]
    params = "?page=#{options[: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

#users_show(id) ⇒ Object



48
49
50
51
52
53
54
# File 'lib/tuiter/methods/user.rb', line 48

def users_show(id)
  if res = @request_handler.get("http://twitter.com/users/show/#{id}.json").body
    return Tuiter::User.new(JSON.parse(res))
  else
    return nil
  end
end