Coder Social home page Coder Social logo

yahoo_sm's Introduction

YahooSM

This gem provides a ruby interface to Yahoo Search Marketing.

Notes

I currently only require the reporting functionality so this gem is currently limited to that. If you'd like to extend it to cover more of the api, pull requests would be welcomed.

Installation

gem install yahoo_sm

Getting Started

Configuring up the client

To configure the client you'll need to create an instance of YahooSM::Client. This takes you username, password, license and master_account_id as arguments.

client = YahooSM::Client.new("your_username", "secret", "1234567890", "123456")

To use the API you then create an instance of YahooSM::API and pass this your client object.

api = YahooSM::API.new(client)

You can now select the service your require to use

report_service = api.service("BasicReportService")

Fetching a list of reports

report_service.get_report_list
# [<ReportInfo>]

Each report will be returned as a ReportInfo object.

Creating a new report

To create a new report you'll need to supply your account_id, a BasicReportRequest object and a FileOutputFormat object.

account_id                = 98765

report_request            = YahooSM::BasicReportRequest.new("Report Name", "Report Type")
report_request.start_date = 2.days.ago
report_request.end_date   = Time.now

FileOutputFormat takes a file type and optionally an argument for zipping the report.

output                    = YahooSM::FileOutputFormat.new("CSV", true)

report_id                 = report_service.add_report_request(account_id, report_request, output)
# returns to report_id

Checking the status of a report

info = report_service.get_report_download_url(report_id)
info.report_status # Pending, Completed etc

If the report is complete then the download_url will be available

Copyright

Copyright (c) 2011 Kieran Johnson. See LICENSE for details.

yahoo_sm's People

Contributors

kieranj avatar

Stargazers

 avatar

Watchers

 avatar  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.