Skip to content

Instantly share code, notes, and snippets.

@ferencbeutel4711
Last active August 29, 2015 14:10
Show Gist options
  • Save ferencbeutel4711/d57ed8fb6c4f760414dc to your computer and use it in GitHub Desktop.
Save ferencbeutel4711/d57ed8fb6c4f760414dc to your computer and use it in GitHub Desktop.
Blog_code
gem install aboutyou-sdk
<%
require 'aboutyou-sdk'
shop = AY.new(100, '3ed93394c2b5ebd12c104b177b928ad0')
searchCriteria = shop.productSearchCriteria.filterBySearchword('Hose')
productSearchResult = shop.fetchProductSearch(searchCriteria)
productSearchResult.products.each do |key, prod|
%>
<p> Produkt-ID : <%= String(prod.id) %> , Name : <%= prod.name %> </p>
<%
end
%>
require 'sinatra'
get "/productSearch" do
erb :productSearch
end
@RainerBlessing
Copy link

The function names need to be changed from camel case to the underscore syntax. (e.g. productSearchCriteria -> product_search_criteria).
The aboutyou-sdk also needs two additional gems: redis and dalli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment