implementing autocomplete in my website - autocomplete

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

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).

Can I use protractor not only for testing but for filling a form automatically, if not what can I do?

A friend of mine has to fill online forms every day, and she wonders if there is a way to make this things automatically because she has all the data in a separate file. I showed her protractor, so she asked me if it is possible to use protractor for filling these forms. I think that one is able to use protractor when owns the project, but I don't really know if it is possible to use it when not. If it is not possible to do it, what can I do. I mean what she can do.
In some cases you could, but mostly no. Protractor only appears to work with websites built using AngularJS, however the website does not need to be served locally. The example on the Protractor homepage performs a test on the public/offical AngularJS website:
browser.get('http://www.angularjs.org');
From your own home computer, you can run automated Protractor/Jasmine tests (or other such things) on public websites built with AngularJS. However, you won't be able to perform a Google Search with this method for example, since http://www.google.com does not use Angular.
For more versatile browser automation, you could look at Greasemonkey for Firefox, or Tampermonkey for Chrome. These allow you to write JavaScript which will run in your browser, on top of a particular website, to modify that website's appearance or behaviour.
One other possibility is to write some kind of full automation script, using Python or BASH/curl. Deconstruct the web forms, treat the website effectively like an API, and use HTTP POST to submit form content. However, this would only be effective if your friend uses a select few web forms since it would need to be heavily custom-designed for each form. Also, it would not allow her to manually interact with the website or enter any values. That said, it is probably the most universal and commonly used method of achieving the automation you speak of. Additionally, the website(s) your friend uses might even publish some kind of official documented API, which would make this process far easier.

How to make registration via API be able only for humans?

I making web service (JSON), and web site, which uses this service. And this web site uses service function "register" to register users in web site. And I dont want to make captcha because its boring to type and easy to make mistakes while typing and I just can to loose my customers while registration procedure. So its easy to make application that will register [user00000#haha.com .. user99999#hehe.com] rage of fake accounts. How to avoid this without typing CAPTCHA?
Thanks in advance
There are a few different approaches you can use, or a combination of them:
You can have your users perform basic math instead of the CAPTCHA.
You can also use javascript to detect bots, since bots typically use straight HTTP requests, however client-side javascript requires a real browser in order to execute:
http://www.kalzumeus.com/2010/06/07/detecting-bots-in-javascrip/
There are some nice alternatives to CAPTCHA, for example this and this and this and this (btw, you can find different alternative-CAPTCHAs here - not all of them are "hard" to use!).
Also, there are some alternative CAPTCHAs that instead of displaying twisted characters - give you a simple arithmetic equation, for example: 3+7= and you have to type in the correct result.

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.