Skip to content

Instantly share code, notes, and snippets.

@softprops
Created May 15, 2009 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save softprops/112060 to your computer and use it in GitHub Desktop.
Save softprops/112060 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "isithotinhere?",
author: {name: "Doug Tangren", homepage: "http://lessis.me/"},
license: "MIT",
description: "is it hot in here or is it just me?",
takes: {"city and state": noun_arb_text},
_hotnessUrl: function(loc) {
var baseUrl = "http://isithotinhereorisitjust.me/check/hotness/";
return baseUrl + loc;
},
preview: function(pblock,loc) {
var cityAndState = loc.text;
if(!cityAndState) {
var currentLoc = CmdUtils.getGeoLocation();
cityAndState = [currentLoc.city," ",currentLoc.state].join("");
}
if(cityAndState) {
jQuery.get(this._hotnessUrl(cityAndState), {}, function(data) {
var parsed = jQuery('*:is(#container)',data).not('form');
pblock.innerHTML = parsed.html();
});
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment