Code Monkey home page Code Monkey logo

Comments (5)

mattherick avatar mattherick commented on August 19, 2024

Okay my fault.. it is possible to configure the host for getting different results depending on the language.
For others:

ASIN::Configuration.configure do |config|
  config.secret        = Rails.application.secrets.amazon["secret_access_key"]
  config.key           = Rails.application.secrets.amazon["access_key_id"]
  config.associate_tag = Rails.application.secrets.amazon["associate_tag"]
  config.host          = "webservices.amazon.de"
end

This would return german results.

Do you have a list of all possible hosts? And maybe you can update your README - the optional host configuration is not mentioned anywhere.

from asin.

jaimerump avatar jaimerump commented on August 19, 2024

@mattherick I've found a list, but I think it's incomplete because I think I remember there being an Indian endpoint that isn't listed there. http://docs.aws.amazon.com/AWSECommerceService/latest/DG/AnatomyOfaRESTRequest.html

from asin.

jaimerump avatar jaimerump commented on August 19, 2024

Springboarding off of this, what if I want to change it dynamically at runtime? I have users from all across the world, and I'd like to serve up their country's version if there is one. Could I do something like this at runtime to change which site I query just for that specific user?

ASIN::Configuration.configure do |config|
  config.host          = "webservices.amazon.de"
end

from asin.

kurtfunai avatar kurtfunai commented on August 19, 2024

👍

from asin.

phoet avatar phoet commented on August 19, 2024

@jaimerump @kurtfunai ❤️ for helping!

confiture has a feature that allows you to set block-scoped configuration. it's also thread-safe:

ASIN::Configuration.with_config(host: "webservices.amazon.de") do
  client.lookup('B0096BYG7C').first.detail_page_url # http://www.amazon.de/Practical...
end

from asin.

Related Issues (20)

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.