Class: Kloutbg
Constant Summary collapse
- VERSION =
'1.2.1'
- @@base_host =
"http://api.klout.com"
- @@api_version =
"1"
- @@api_key =
""
Class Method Summary collapse
- .api_key ⇒ Object
- .api_key=(api) ⇒ Object
- .base_host=(host) ⇒ Object
- .base_key ⇒ Object
-
.history(username, measure, start_date, end_date) ⇒ Object
User method: /history.
-
.influenced_by(username) ⇒ Object
Relationship method: /influenced_by.
-
.influencer_of(username) ⇒ Object
Relationship method: /influencer_of.
- .initialize(api_key) ⇒ Object
-
.klout(username) ⇒ Object
Score method: /klout.
-
.show(username) ⇒ Object
User method: /show.
-
.stats(username) ⇒ Object
User method: /stats.
-
.topics(username) ⇒ Object
User method: /topics.
Class Method Details
.api_key ⇒ Object
33 34 35 |
# File 'lib/klout.rb', line 33 def api_key @@api_key end |
.api_key=(api) ⇒ Object
25 26 27 |
# File 'lib/klout.rb', line 25 def api_key=(api) @@api_key = api end |
.base_host=(host) ⇒ Object
21 22 23 |
# File 'lib/klout.rb', line 21 def base_host=(host) @@base_host = host end |
.base_key ⇒ Object
29 30 31 |
# File 'lib/klout.rb', line 29 def base_key @@base_host end |
.history(username, measure, start_date, end_date) ⇒ Object
User method: /history
66 67 68 69 70 |
# File 'lib/klout.rb', line 66 def history(username,measure,start_date,end_date) #http://api.klout.com/1/users/topics.[xml_or_json]?key=[your_api_key]&measure=[measure]&start_date=[start_date]&end_date=[end_date]&users=[usernames] request_uri = "/#{@@api_version}/users/history.json?key=#{@@api_key}&measure=#{measure}&start_date=#{start_date}&end_date=#{end_date}&users=#{username}" self.class.get(@@base_host + request_uri) end |
.influenced_by(username) ⇒ Object
Relationship method: /influenced_by
73 74 75 76 77 |
# File 'lib/klout.rb', line 73 def influenced_by(username) #http://api.klout.com/1/soi/influenced_by.[xml_or_json]?key=[your_api_key]&users=[usernames] request_uri = "/#{@@api_version}/soi/influenced_by.json?key=#{@@api_key}&users=#{username}" self.class.get(@@base_host + request_uri) end |
.influencer_of(username) ⇒ Object
Relationship method: /influencer_of
80 81 82 83 84 |
# File 'lib/klout.rb', line 80 def influencer_of(username) #http://api.klout.com/1/soi/influencer_of.[xml_or_json]?key=[your_api_key]&users=[usernames] request_uri = "/#{@@api_version}/soi/influencer_of.json?key=#{@@api_key}&users=#{username}" self.class.get(@@base_host + request_uri) end |
.initialize(api_key) ⇒ Object
17 18 19 |
# File 'lib/klout.rb', line 17 def initialize(api_key) @@api_key = api_key end |
.klout(username) ⇒ Object
Score method: /klout
38 39 40 41 42 |
# File 'lib/klout.rb', line 38 def klout(username) #request_uri = "http://klout.com/api/twitter/1/klout/#{@@api_key}/#{username}.json" request_uri = "/#{@@api_version}/klout.json?key=#{@@api_key}&users=#{username}" self.class.get(@@base_host + request_uri) end |
.show(username) ⇒ Object
User method: /show
45 46 47 48 49 |
# File 'lib/klout.rb', line 45 def show(username) #http://api.klout.com/1/users/show.[xml_or_json]?key=[your_api_key]&users=[usernames] request_uri = "/#{@@api_version}/users/show.json?key=#{@@api_key}&users=#{username}" self.class.get(@@base_host + request_uri) end |
.stats(username) ⇒ Object
User method: /stats
59 60 61 62 63 |
# File 'lib/klout.rb', line 59 def stats(username) #http://api.klout.com/1/users/stats.[xml_or_json]?key=[your_api_key]&users=[usernames] request_uri = "/#{@@api_version}/users/stats.json?key=#{@@api_key}&users=#{username}" self.class.get(@@base_host + request_uri) end |
.topics(username) ⇒ Object
User method: /topics
52 53 54 55 56 |
# File 'lib/klout.rb', line 52 def topics(username) #http://api.klout.com/1/users/topics.[xml_or_json]?key=[your_api_key]&users=[usernames] request_uri = "/#{@@api_version}/users/topics.json?key=#{@@api_key}&users=#{username}" self.class.get(@@base_host + request_uri) end |