Skip to content

jsboulanger/commission_junction

 
 

Repository files navigation

commission_junction

Ruby wrapper for the Commission Junction web services APIs (REST)

Installation

sudo gem install commission_junction

Example

require 'rubygems'
require 'commission_junction'

# See https://api.cj.com/sign_up.cj
DEVELOPER_KEY = '????????'

# See cj.com > Account > Web site Settings > PID
WEBSITE_ID = '????????'

cj = CommissionJunction.new(DEVELOPER_KEY, WEBSITE_ID)

# See http://help.cj.com/en/web_services/product_catalog_search_service_rest.htm
# for the list of request and response parameters.
cj.product_search('keywords' => '+blue +jeans',
                  'advertiser-ids' => 'joined',
                  'serviceable-area' => 'us',
                  'currency' => 'usd',
                  'records-per-page' => '5').each do |product|
  puts product.name
  puts product.price
  puts product.image_url
  puts ''
end

# See http://help.cj.com/en/web_services/advertiser_lookup_service_rest.htm
# for the list of request and response parameters.
cj.advertiser_lookup('keywords' => '+used +books'

‘advertiser-ids’ => ‘joined’, ‘records-per-page’ => ‘5’).each do |advertiser|

  puts advertiser.advertiser_name
  puts advertiser.network_rank
  puts advertiser.program_url
  puts ''
end

puts cj.categories

Dependencies

  • httparty

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit. Do not mess with Rakefile, VERSION, or history (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull).

  • Send me a pull request. Bonus points for topic branches.

  • This project uses Jeweler to manage its RubyGem. You do not need to create a separate gemspec file.

Copyright © 2011 Albert Vernon. See LICENSE for details.

About

Commission Junction web services APIs (REST)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%