An open API service indexing awesome lists of open source software.

https://github.com/thinkphp/request.keywords

This is a quick hack based on MooTools which tries to find keywords connected to a certain term.
https://github.com/thinkphp/request.keywords

Last synced: 7 months ago
JSON representation

This is a quick hack based on MooTools which tries to find keywords connected to a certain term.

Awesome Lists containing this project

README

          

Request.Keywords
=======================
Request.Keywords is plugin MooTools which tries to find keywords connected to a certain term.

![Screenshot](http://farm5.static.flickr.com/4151/4836983051_5006fe627c_z.jpg)

How to use
----------

First you must to include the JS files in the head of your HTML document.

#HTML


In your JavaScript source:

#JS
window.addEvent('domready',function(){
new Request.Keywords('mootools', 'us', 'en', {
onSuccess: function(o) {
if(window.console) {console.log(o);}
if(o.query.results.keywords) {
var term = o.query.results.keywords.search;
var kw = o.query.results.keywords.terms;
var language = o.query.results.keywords.language;
var region = o.query.results.keywords.region;
var out = '

You searched for '+term+' in '+ language +'

'+
'

We found these related keywords:

'+
'

'+kw.replace(/,/g,', ')+'

';
$('keywords').set('html',out);
} else {
$('keywords').set('text','There was an error, please try again.');
}
},
onRequest: function(script) {
if(window.console) {console.log(script);}
$('keywords').set('text','Loading...');
}
}).send();

$('another_keywords').loadKeywords('python');
}

In your HTML source:

#HTML



Dependencies

MooTools Core 1.3.0
MooTools More: Request.JSONP

Notes:

You can view in action:

- [http://thinkphp.ro/apps/js-hacks/Request.Keywords/demo1.html](http://thinkphp.ro/apps/js-hacks/Request.Keywords/demo1.html)
- [http://thinkphp.ro/apps/js-hacks/Request.Keywords/demo2.html](http://thinkphp.ro/apps/js-hacks/Request.Keywords/demo2.html)
- [http://thinkphp.ro/apps/js-hacks/Request.Keywords/demo3.html](http://thinkphp.ro/apps/js-hacks/Request.Keywords/demo3.html)
- [http://thinkphp.ro/apps/js-hacks/Request.Keywords/demo4.html](http://thinkphp.ro/apps/js-hacks/Request.Keywords/demo4.html)