Using Amazon's affiliate API for autocompletion - autocomplete

On a website I'm building a search for Amazon products. This should display some information on the products I can pick up using their affiliate API. I can look up information on the products using this dependency (which I'm not entirely happy about, because I should probably create my own package from their provided WSDL), but I'm not entirely sure what would be the best way to implement an autocomplete in a searchbox for their products.
I want to load the autocomplete information from my own server rather than one of Amazon's, but I am not certain what the recommended way to do this would be. Through the provided Amazon affiliate API or is there a better way?
As a summary, I am looking for a way where I have a textbox with autocompletion on my website, that uses my own server to do the autocompletion (example.com/search/autocomplete/%QUERY%), which should then call some autocompletion functionality on the Amazon API.

Amazon offers -next to their affiliate API- a webservice which can be used to get their autocomplete information. It can be utilized by calling an URL in the style of:
http://completion.amazon.com/search/complete?search-alias=aps&client=amazon-search-ui&mkt=1&q=canon
Where the contents of q is the query that you want autocompleted.

I created a vanilla JavaScript plugin to integrate the Amazon Autocomplete webservice into a search input.
Fortunately, the Amazon webservice is JSONP enabled so it let you handle the requests via <script> tags and callbacks, which is already implemented in the plugin.
https://github.com/caroso1222/amazon-autocomplete

Related

Can Squarespace connect to an external Json Rest-API...?

I am new to Squarespace and I was wondering if it can interact with an external Rest-API using JSON?
For example, say I have a Database being hosted privately and I want data from it to be shown via Squarespace and certain pages being restricted according to the user's privileges.
Is any of the above possible, and if so can you direct me to an example? I seem not to be able to find anything on the above via google.
Thanks
From Squarespace:
Squarespace doesn’t support server-side code, including PHP, Ruby, Ruby on Rails, and SQL.
Therefore, the only way to connect to an external API (besides those supported by Squarespace's official 'extensions') is to use "client-side" (in-browser) JavaScript.
So, the database solution which you use must be capable of securely handling client-side connections (for example, Firebase can do that). To interface with it, you must add the JavaScript to your Squarespace site via code block or code injection. An example explanation of doing that can be found at this question.
As to allowing/disallowing content based on data returned from the database, it can be done, but only client-side. That means that, while you can make the site appear to restrict access and/or make it inconvenient for others to access certain pages based on information in the database, because it is all client-side, it could technically be circumvented by someone if they are familiar with web-development, web-inspector, etc. So it's not something you'd want to do if it is critical that the content be truly restricted.
Squarespace does have its own "Members Areas" which can be used to solve content access problems. However, it's extremely limited at the moment, and there are many scenarios it does not address.

Change CKAN API Interface - are there limitations on the API?

I've looked around the site to see if there are any people who have changed the CKAN API interface so that instead of uploading documents and databases, they can directly type onto the site, but I haven't found any use cases.
Currently, we have a page where people upload data sets through excel forms that they've filled out, but we want to make it a bit more user friendly by changing the API so that they can fill out a form on the page rather than downloading the template, filling it out and then uploading it.
Does CKAN have the ability to support this? If so, are there any examples or use cases of websites that have use forms rather than uploads?
This is certainly possible.
I'm not aware of any existing extensions that provide that functionality, but you can check the official list of CKAN extensions if there's anything that fulfills your needs.
If there is no existing extension that suits you then you could write your own, see the extension guide for details on how to do that.
Adding an API function to CKAN's API is possible, but probably not what you want in this case: the web UI usually does not interact with CKAN via the API but via Flask/Pylons controllers. Hence, you would add your add controller which first serves your form and then processes the submitted inputs.
You can take a look at the ckanext-pages extension, which does exactly that (for editing static pages instead of datasets, but your code would be similar).

How to integrate a comment system in an ios app?

Lets say my web server app is in drupal or wordpress, or even code igniter, how would one get about integrating a comment system? TSpecifically what I am trying to find out is if anyone was able to find a successful approach that would save some time as opposed to me going down the road of tying myself to a specific CMS content system.
Just throwing in some considerations here (by no means complete):
Are users also accessing your content (and its comment system) via the website?
If so, you'll want to have a comment interface that is available on the website too, and the easiest choice may be to use the comment system natively supplied by your CMS / through plugins.
If on the other hand your users will only be using the iOS app(s) for commenting (via a native interface) or you'll be heavily customizing the website anyway, using a comment system independent from your CMS might be an option.
How will the content be accessed from the app?
Via a simple web view? Or will the app download via an API provided by your CMS and display it in a native UI? If you are using an API provided by your CMS, you will have the same issue with your content as with your comments when moving CMSes.
You could add an intermediate layer that abstracts from the specific CMS API.
Or if you don't really plan on moving CMSes but want to prepare for that event nevertheless, you could simply implement a no-frills "version check" to ask the server for the CMS kind / version it is using, and if it doesn't match what your app expects, ask the users to update. This isn't the prettiest user experience, but it might be sufficient depending on what you're actually planning.

implementing autocomplete in my website

i am developing a website where i intend to provide the search feature. I am developing it in PHP/MYSQL and i have written the script to perform the search. I wish to provide autocomplete or suggested searches option in the search box as the user types, can i know what are my choices and how can i make use of them?
I had tried YUI Autocomplete, it looks good to me, however i do not understand when it says using a local proxy for the datasource. Can any one help me out here?
Consider trying the Scriptaculous autocomplete. It's very easy to implement.
what does it exactly say on the documentation? (can you provide a link)
by local proxy I would think it means a proxy to a remote web service or API on another domain. (you can't make requests unless scripts are executed on the same domain). http://developer.yahoo.com/javascript/howto-proxy.html
I used jQuery autocompletex

Using web hit counter to track application usage, recommendations wanted

I have an internal tool written in java. It would be useful to get a little
feedback on how much it is used by colleagues.
A simple solution would be to have the application display an image which it fetches from
a web hit counter like application and just look at how often the image is accessed.
So what I am looking for: a stand-alone application (i.e. no Apache modules, cgi scripts, etc),
which serves one or a couple of static images and and can log accesses, preferably with as
little as possible of support of everything else.
Searching for "hit counter" gave little relevant, "lightweight http server" was more relevant, although mostly overkill still. Any suggestions?
You could try using Google Analytics. Most of the time, people using Google Analytics are tracking pageviews on a web page, and Google Provides some javascript that you can place on your page and it will track the visits to that page as well as browser capabilities/etc. Behind the scenes, that javascript is placing an image tag on the page in the manner you describe.
However, since your application is java and not a web app (I assume it's a standalone and not an applet), you won't be able to include Google's javascript (unless you embed a javascript interpreter...yick). Fortunately, it is possible to use Google's analytics without javascript.
The trick is that Google's scripts use the image http://www.google-analytics.com/__utm.gif and pass parameters via the query string. You can find a list of the parameters you can pass to the query string here. So all you'd have to do is figure out what the query string should be and have your client make the request to google's image (after setting up your google analytics account, of course).
Just use Google Analytics, it's really easy and requires a short script on your pages.
Michal Kebrt's simple UNIX HTTP server does exactly what I was looking for.