All pastes #1948874 Raw Edit

nabber

public text v1 · immutable
#1948874 ·published 2010-09-26 13:11 UTC
rendered paste body
var s={
"ars":["Ars Technica","http://arstechnica.com/"],
"apv":["Associated Press Videos","http://m.youtube.com/profile?user=associatedpress"],
"b ":["Bing Search","http://m.bing.com/search/search.aspx?a=webresults&q=%s"],
"bi ":["Bing Image Search","http://m.bing.com/search/search.aspx?a=imageresults&q=%s"],
"bn ":["Bing News Search","http://m.bing.com/search/search.aspx?a=newsresults&q=%s"],
"bm":["Bloomberg","http://mobile.bloomberg.com/"],
"bmv":["Bloomberg Videos","http://m.youtube.com/profile?user=Bloomberg"],
"d ":["English Dictionary","http://www.google.com/gwt/x?u=http://www.google.com/dictionary%3Flangpair%3Den|en%26q%3D%s&btnGo=Go&source=wax&ie=UTF-8&oe=UTF-8"],
"fl":["Flight Stats","http://mobile.flightstats.com/"],
"g":["iGoogle","http://www.google.com/m/ig"],
"g ":["Google Search","http://www.google.com/m?q=%s"],
"gi ":["Google Image Search","http://www.google.com/m?site=images&q=%s"],
"gm":["GMail","https://mail.google.com/mail/x/gp"],
"gn ":["Google News Search","http://www.google.com/m/news?q=%s"],
"gq ":["Google Quotes\/Symbol Lookup<br\/>e.g.'gq goog','gq starbucks'","http://www.google.com/m?site=finance&q=quote:%s"],
"gqn ":["Google News (Symbol)<br\/>e.g.'gqn goog'","http://www.google.com/finance/company_news?q=%s&output=rss"],
"h":["Hacker News","http://news.ycombinator.com/"],
"ix":["IEEEXplore","http://ieeexplore.ieee.org/mobile/"],
"ix ":["IEEEXplore Search","http://ieeexplore.ieee.org/mobile/MobileSearch.jsp?oqs=&queryText=%s&rowsPerPage=10&newsearch=true"],
"l":["Lifehacker","http://m.lifehacker.com/"],
"l ":["Lifehacker Search","http://www.google.com/m?q=%s%20site:m.lifehacker.com"],
"od ":["Opera Dev Search","http://dev.opera.com/search/?term=%s"],
"omf":["Opera Mini Forum","http://my.opera.com/community/forums/forum.dml?id=111"],
"omf ":["Opera Mini Forum Search","http://my.opera.com/community/forums/search.dml?id=111&term=%s"],
"op ":["Opera People Search","http://my.opera.com/community/members/search/?q=%s"],
"r":["Reuters","http://mobile.reuters.com/"],
"r ":["Reuters Search","http://mobile.reuters.com/mobile/m/Search?keyWords=%s"],
"w ":["Wikipedia Search","http://en.m.wikipedia.org/wiki?search=%s"],
"wn":["Wired News","http://m.wired.com/"],
"wn ":["Wired News Search","http://m.wired.com/search?query=%s&siteAlias=all&x=0&y=0"],
"wr ":["Weather Search","http://m.yahoo.com/w/search?p=weather%20%s"],
"y":["Yahoo! Home","https://mlogin.yahoo.com/w/ygo-frontpage/home.bp%3B_ylt=?view=fav&.ts=&.intl=us&.lang=en"],
"y ":["Yahoo! Search","http://m.yahoo.com/w/search?p=%s"],
"yi ":["Yahoo! Image Search","http://m.yahoo.com/w/search?stype=image&p=%s"],
"ym":["Y!Mail","http://m.yahoo.com/w/ygo-mail?.intl=us&.lang=en"],
"yn ":["Yahoo! News Search","http://m.yahoo.com/w/search?stype=news&p=%s"],
"yq ":["Yahoo! Quotes\/Currencies<br\/>e.g.'yq yhoo','yq usdcad=x'","http://m.yahoo.com/w/search/lp/finance/quote/%s"]
};
w=window.innerWidth-15+'px';
e=encodeURIComponent;
d=document.getElementsByTagName('body')[0];
x=1;
f=function(q){
 k=q.replace(/^([^\s]+\s?).*/,"$1").toLowerCase();
 p=e(q.replace(/^[^\s]+\s(.*)/,"$1"));
 if(k=='help'){
  d.innerHTML='<style type="text\/css">body{font-size:12px;}div{width:'+w+';word-wrap:break-word;}i{color:#aaa;padding:0 0.5em 0;}b{background-color:#666;color:#fff;font:12px monospace;padding:2px;}<\/style>';
  d.innerHTML+='<h3>Available Shortcuts:<\/h3><div>';
  for(i in s) d.innerHTML+='<b>'+i+'<\/b>&nbsp;: '+s[i][0]+'<br\/><i>'+s[i][1]+'<\/i><br\/>';
  d.innerHTML+='<h3>Query:<\/h3><input id="fd" size="16"\/><input type="button" value="Enter" onclick="f(document.getElementById(\'fd\').value);"\/><\/div>';
 }else{
  for(i in s)
   if(i==k) {location.href=s[i][1].replace(/%s/,p);x=0;}
  if(x) alert('Cannot match shortcut. Typo?');
 }
};
q=prompt("Enter 'help' for available shortcuts"); if(q)f(q);