My ubiquity command to search Guruji

CmdUtils.CreateCommand({
name:
“guruji-movies”,
description:
‘Searches Guruji for Movies’,
help:
‘The command works like this, you have to set the mycity parameter in guruji to your own city i havent been able to set it myself using this tool.guruji-movies movie (theater) name is the command format.For eg: guruji-movies dasavatharam will give a list of theaters in mycity that shows the movie.You can also just give the name of the theater and get the list of movies.Now the preview is very nascent i dont know whether guruji gives API like google if so i will use jquery to get a preveiw rether than opening in browser window.Go ahead and improve this u have every right to do it.’,
homepage:
http://ashoktherock.wordpress.com’,
author:{
name:’Ashok’,
email:’samrat.ashok87@gmail.com’,
},
licence:
‘GPL’,
takes: {“movie”:noun_arb_text},
modifiers:{theater:noun_arb_text,city:noun_arb_text},

if(theater!=”undefined”)
{
baseurl=”http://guruji.com/movietiming?hl=en&q=”+movie1+theater+”&=”+city;
}
else{
baseurl=”http://guruji.com/movietiming?hl=en&q=”+movie1+”&=”+city;

preview:function(pblock,movie,mods)
{
var msg = ‘Searches for “${whatText}” in ${withText} in ${inText}.’;
var subs = {whatText: movie.text, withText: mods.theater.text, inText: mods.city.text};

pblock.innerHTML = CmdUtils.renderTemplate( msg, subs );
},

execute:function(movie,mods){
var movie1=””;
var theater=””;

if(movie){
movie1=movie.text;
}
if(mods.theater.text)
{
theater=mods.theater.text;
}
var city=”bangalore”||mods.city.text;
var baseurl

}Utils.openUrlInBrowser(baseurl);
}
});

Tutorial soon 🙂

Advertisements

Published by

samratashok

An Insane just adding irregularity to the universe

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s