You have a Klip that depends on geographic data, but you don't want your users to have to enter their data in the setup window.
if(Prefs.getPref("firstRun") == "Yes")
{
Prefs.setPref("firstRun", "No");
var locReq = Engines.HTTP.newRequest("http://api.hostip.info/get_html.php");
if(locReq.send())
{
var loc_re = new RegExp("Country: ([^]*?)City: ([^]*)");
var locInfo = loc_re.exec(locReq.response.data);
if(locInfo[2].toLowerCase().indexOf("unknown") == -1)
{
// Don't use the geo data if the city is unknown.
// locInfo[1] is the country.
// locInfo[2] is the city.
}
}
}
Check out the Google News Klip for an example of this in action.