Code Monkey home page Code Monkey logo

romniture's Introduction

romniture

To be pronounced...RAWWWRROMNITURE

what is it

romniture is a minimal Ruby wrapper to Omniture's REST API. It follows a design policy similar to that of sucker built for Amazon's API.

Omniture's API is closed, you have to be a paying customer in order to access the data.

installation

[sudo] gem install romniture

initialization and authentication

romniture requires you supply the username, shared_secret and environment which you can access within the Company > Web Services section of the Admin Console. The environment you'll use to connect to Omniture's API depends on which data center they're using to store your traffic data and will be one of:

Here's an example of initializing with a few configuration options.

client = ROmniture::Client.new(
  username, 
  shared_secret, 
  :san_jose, 
  :verify_mode	=> nil	# Optionaly change the ssl verify mode.
  :log => false,    		# Optionally turn off logging if it ticks you off
  :wait_time => 1   		# Amount of seconds to wait in between pinging 
                    		# Omniture's servers to see if a report is done processing (BEWARE OF TOKENS!)
  )

usage

There are only two core methods for the client which doesn't try to "over architect a spaghetti API":

  • get_report - used to...while get reports and
  • request - more generic used to make any kind of request

For reference, I'd recommend keeping Omniture's Developer Portal open as you code . It's not the easiest to navigate but most of what you need is there.

The response returned by either of these requests Ruby (parsed JSON).

examples

# Find all the company report suites
client.request('Company.GetReportSuites')

# Get an overtime report
client.get_report "Report.QueueOvertime", {
  "reportDescription" => {
    "reportSuiteID" => "#{@config["report_suite_id"]}",
    "dateFrom" => "2011-01-01",
    "dateTo" => "2011-01-10",
    "metrics" => [{"id" => "pageviews"}]
    }
  }

see also

My other client library comscore_ruby for those of you looking to pull data from comscore as well.

romniture's People

Contributors

imartingraham avatar msukmanowsky avatar

Watchers

 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.