Project

klout-rb

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper for the Klout REST API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.9.2.2
~> 2.7.0
~> 1.7.7

Runtime

~> 1.2.0
~> 0.9.5
~> 1.0.3
 Project Readme

Klout Build Status Dependency Status

Ruby wrapper for the Klout REST API

Installation

Klout is available through Rubygems and can be installed via:

gem install klout-rb

Usage

Configure API key

Klout::Client.configure do |config|
  config.api_key = "<YOUR_API_KEY>"
end

Get users klout score

Klout::Client.score("ladygaga", "davidguetta").map do |user|
  "#{user.twitter_screen_name}: #{user.kscore}"
end

Get users klout profile

Klout::Client.score("ladygaga", "davidguetta").map do |user|
  "#{user.twitter_screen_name}: #{user.score.true_reach}"
end

Get users topics

Klout::Client.topics("ladygaga", "davidguetta").map do |user|
  "#{user.twitter_screen_name}: #{user.topics.join(',')}"
end

Get users influencers

Klout::Client.influenced_by("ladygaga", "davidguetta").map do |user|
  "#{user.twitter_screen_name}: #{user.influencers.map { |i| i.twitter_screen_name }.join(',')}"
end

Get users influencees

Klout::Client.influencer_of("ladygaga", "davidguetta").map do |user|
  "#{user.twitter_screen_name}: #{user.influencees.map { |i| i.twitter_screen_name }.join(',')}"
end

Performance

Klout-rb uses multi_json for parsing JSON responses and HTTPI for making HTTP requests.

You can use yajl and httpclient for better performance.