Code Monkey home page Code Monkey logo

ralexa's Introduction

Ralexa

Ruby client for Amazon Alexa APIs.

These include Alexa Top Sites and Alexa Web Information Service.

HTTP transport thanks to Net::HTTP, with a little help from addressable.

XML parsing courtesy of Nokogiri.

Thorough test coverage provided by MiniTest::Spec.

Installation

# with bundler
echo 'gem "ralexa"' >> Gemfile
bundle

# or just the gem
gem install ralexa

Usage Examples

# grab a Ralexa::Session instance to hold your credentials.
session = Ralexa.session("aws_access_key_id", "aws_secret_access_key")

# all countries
countries = session.top_sites.list_countries
p countries.map(&:name)

# global top 250 sites
global = session.top_sites.global(250)

# per-country top sites
first_by_country = {}
countries.each do |c|
  first_by_country[c.name] = session.top_sites.country(c.code, 1).first.url
end

# individual country lookup
puts "Top Ten Australian Sites"
session.top_sites.country("AU", 10).each do |s|
  puts "#{s.url} (#{s.page_views} pageviews)"
end

# url info for an individual site
puts "Url info of Flippa.com"
puts session.url_info.get("http://flippa.com")

puts "bam!"

Status

Service Action ResponseGroup Supported
Alexa Top Sites TopSites Global Yes
Country Yes
ListCountries Yes
Alexa Web Information Services UrlInfo Get Yes
TrafficHistory * Send a pull request!
CategoryBrowse * Send a pull request!
CategoryListings * Send a pull request!
SitesLinkingIn * Send a pull request!

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b some-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin some-new-feature)
  5. Create new Pull Request

License

(c) 2012 Flippa, The MIT License.

ralexa's People

Contributors

pda avatar lsimoneau avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.