Last active
August 29, 2015 14:10
-
-
Save ferencbeutel4711/d57ed8fb6c4f760414dc to your computer and use it in GitHub Desktop.
Blog_code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install aboutyou-sdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
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 | |
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
get "/productSearch" do | |
erb :productSearch | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.