mhuggins / a2z Goto Github PK
View Code? Open in Web Editor NEWSimple Ruby DSL for searching & retrieving items from the Amazon Product Advertising API
License: MIT License
Simple Ruby DSL for searching & retrieving items from the Amazon Product Advertising API
License: MIT License
I am getting undefined method error while trying to instantiate the 'client'. I am newbie, would truly appreciate any help.
client = A2z::Client.new(key: 'YOUR_KEY', secret: 'YOUR_SECRET', tag: 'YOUR_TAG')
I have double checked the details they are correct.
this is how my terminal output looks like
Started GET "/" for 127.0.0.1 at 2015-04-22 00:45:57 +0530
Processing by PagesController#index as HTML
Completed 500 Internal Server Error in 0ms
NoMethodError (undefined method `key=' for #<A2z::Client:0x007fc6ced596b0>):
I manually tested this gem in irb while building it out, but I never got around to building any kind of unit tests.
Hi there. First of all: awesome gem. Seriously nice, extremely nice compared to vacuum/sucker.
I've been successfully getting responses, but i'm having trouble with offers.
Somehow I cant get any offer across. Is there something I forgot?
client = A2z::Client.new(key: '[key]', secret: '[secret]', tag: '[tag]')
response = client.item_lookup do
id 'B004MPQXZ0' (tried several products, also the ones that were for sale online)
end
response.item.offers = always nil. Any ideas why?
Thanks again!
It's work perfectly but if I add "BrowseNodes" to Response Group it doesn't return the Browse node for each ASIN. How do I get the Browser node? I am interested into root category (eg. Home, Kitchen, Home Improvement etc..)
response = client.item_search do
category 'All'
keywords "Test"
response_group('Images, ItemAttributes, OfferListings, SalesRank, BrowseNodes')
end
p response
I am working with amazon product api and use this gem. It is not compitable with the specified version of ruby and rails.
It shows "key=" is not define when i am initiate client like bellow:
client = A2z::Client.new(key: 'My_KEY', secret: 'My_SECRET', tag: 'My_TAG')
Any idea?
The gemspec includes jeff (unversioned), which is defaulting to the latest release at jeff 0.7.0. This is causing an error, and manually downgrading to jeff 0.6.4 is the workaround. Planning to update a2z to either specify jeff 0.6.4 or work with jeff 0.7.0, unless someone beats me to the punch.
Amazon's Product API provides error codes & messages as part of the response. Errors do not necessarily mean there is an error with the search syntax, so I don't think raising is a correct approach to handling errors in the response. For example, simply finding no matching products with a valid search syntax yields an error code/message pair.
When errors are returned, they should be accessible via an accessor (as an array) on the response object. For example:
response = client.item_search { ... }
response.errors.size # => 2
error = response.errors.first # => #<A2z::Responses::Error ...>
error.code # => "Some Amazon Code"
error.message # => "Some human readable message"
I'm attempting to access top sellers in a category (in this case, using 1000 as per the example in the documentation). I'm receiving the following:
top_item = node.top_sellers.first
NoMethodError: undefined method `top_sellers' for #<A2z::Responses::BrowseNode:0x007f88dee27098>
$ rails c
Loading development environment (Rails 4.1.1)
2.1.2 :001 > config = YAML.load_file(Rails.root.join('config', 'amazon.yml'))
=> {"key"=>"your_key", "secret"=>"your_secret", "tag"=>"your_tag"}
2.1.2 :002 > client = A2z::Client.new(config)
NoMethodError: undefined method `key=' for #A2z::Client:0x00000004fd4068
Why is key= undefined? and yet your build is passing?
I couldn't get this to work with VCR. Just thought I'd post on what happened.
a2z requires Jeff. jeff-0.5.0 depends on [excon (~> 0.18.0)]
If I wire up VCR with excon then it complains:
You are using Excon 0.18.5. VCR is known to work with Excon >= 0.9.6, < 0.17. It may not work with this version.
So there's an impasse here. I have to have 0.18.0+ but I can't have 0.18.0+ ๐
Does a2z really need >= 0.18.0?
I understand that this is really an issue with VCR but I thought I'd ask how you'd cache or mock the webservice calls to AWS. Thx mucho.
Weirdly, VCR managed to write something out as I was testing different versions. I got a YAML file with a User-Agent of Jeff and recorded_with: VCR 2.0.0.rc2
. So maybe there's a path forward there. I'll play with it some more.
I believe I have set it up correctly. I am getting a response that has an 'item' method in it, but the item is always nil when I do a product lookup. I have tried multiple product IDs, and different response groups.
The object I'm interacting with is A2z::Responses::ItemLookup. Is that correct?
Thanks.
First, I love this gem. What a lifesaver it is! Thank you for all of your hard work. I'm wondering if you could help me whit this issue:
http://stackoverflow.com/questions/18304168/ruby-gem-cant-convert-string-into-integer-error
Do you have plans to support batch requests?
Exception details are below:
NoMethodError: undefined method []' for nil:NilClass from ~/.rvm/gems/ruby-1.9.3-p286/gems/a2z-0.1.1/lib/a2z/responses/offer_summary.rb:51:in
block in from_response'
if data['LowestNewPrice']
offer_summary.lowest_new_price = Money.new(data['LowestNewPrice']['Amount'].to_i, data['LowestNewPrice']['CurrencyCode'])
end
if data['LowestUsedPrice']
offer_summary.lowest_used_price = Money.new(data['LowestNewPrice']['Amount'].to_i, data['LowestNewPrice']['CurrencyCode'])
end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.