Ruby Library for AWIS REST API - see: Alexa Docs
gem install awis-sdk-ruby
require 'awis'
AWIS_CONFIG = YAML.load(File.read('awis.yml'))
Awis.config do |c|
c.access_key_id = AWIS_CONFIG['access_key_id']
c.secret_access_key = AWIS_CONFIG['secret_access_key']
c.debug = AWIS_CONFIG['debug']
c.protocol = 'https' # Default 'https'
c.timeout = 10 # Default 10
c.open_timeout = 10 # Default 10
c.logger = false # Default nil
end
client = Awis::Client.new
url_info = client.url_info(url: "site.com")
If you looking for the API request URI:
Awis::API::UrlInfo.new.load_request_uri(url: 'site.com')
returns object that contains attributes:
New methods:
pretty_xml
method will easily to review the XML response from the terminal
returns object that contains relationships:
contact_info
content_data
usage_statistics
related_links
categories
You can specify options:
client = Awis::Client.new
sites_linking_in = client.sites_linking_in(url: "site.com")
If you looking for the API request URI:
Awis::API::SitesLinkingIn.new.load_request_uri(url: 'site.com')
Returns object that contains relationships:
You can specify options:
client = Awis::Client.new
traffic_history = client.traffic_history(url: "site.com")
If you looking for the API request URI:
Awis::API::TrafficHistory.new.load_request_uri(url: 'site.com')
Returns object that contains methods:
Returns object that contains relationships:
You can specify options:
client = Awis::Client.new
category_listings = client.category_listings(path: "Top/Arts")
If you looking for the API request URI:
Awis::API::CategoryListings.new.load_request_uri(path: "Top/Games/Card_Games")
Returns object that contains methods:
Returns object that contains relationships:
client = Awis::Client.new
category_browses = client.category_browse(path: "Top/Arts")
If you looking for the API request URI:
Awis::API::CategoryBrowse.new.load_request_uri(path: "Top/Games/Card_Games")
Returns object that contains methods:
Returns object that contains relationships:
You can retrieve status code and requestID
Awis is using nokogiri
to parse XML documents.
Copyright (c) Encore Shao. See LICENSE for details.