Skip to content

Instantly share code, notes, and snippets.

@egm0121
Created August 20, 2012 21:45
Show Gist options
  • Save egm0121/3408183 to your computer and use it in GitHub Desktop.
Save egm0121/3408183 to your computer and use it in GitHub Desktop.
upCloo suggest getData plugin
(function(g){ return "upcloo" in g && "suggest" in g.upcloo ? g.upcloo.suggest.getData = function(){ return ["SOME","JSON"];} :false;})(this);
(function(g){ return "upCloo" in g && "suggest" in g.upCloo ? g.upCloo.suggest.getData = function(){ return ["SOME","JSON"];} :false;})(this);
@wdalmut
Copy link

wdalmut commented Aug 21, 2012

Ok! I prepare a real example.

@wdalmut
Copy link

wdalmut commented Aug 21, 2012

(function(g){ return "upcloo" in g && "suggest" in g.upcloo ? g.upcloo.suggest.getData = function(){ return [

{
    "title":"Pro Evolution Soccer 2008 anche per Nintendo Wii", 
    "url":"http://www.xxxxxxx.it/cont/news/pro-evolution-soccer-2008-anche-per-nintendo-wii/11113/1.html",
    "image":""
},
{
    "title":"Pro Evolution Soccer 2008: su Wii a marzo", 
    "url":"http://www.xxxxxxx.it/cont/news/pro-evolution-soccer-2008-su-wii-a-marzo/12677/1.html",
    "image":""
},
{
    "title":"Pro Evolution Soccer 2008: da simulazione ad arcade", 
    "url":"http://www.xxxxxxx.it/cont/articolo/pro-evolution-soccer-2008-da-simulazione-ad-arcade/21757/1.html",
    "image":""
}];} : false;})(this);

@egm0121
Copy link
Author

egm0121 commented Aug 21, 2012

Minor fix the main namespace for the upcloo js lib is actually 'upCloo' (camelCase)

@wdalmut
Copy link

wdalmut commented Aug 23, 2012

I've fixed.

@wdalmut
Copy link

wdalmut commented Aug 23, 2012

Just 629 bytes using 3 proposals and JS compression, 273 bytes gzipped and JS compression

@wdalmut
Copy link

wdalmut commented Aug 23, 2012

Mark this as closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment