1 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
2 Components.utils.import(
"resource://app/jsmodules/sbLibraryUtils.jsm");
3 Components.utils.import(
"resource://app/jsmodules/sbProperties.jsm");
5 const Cc = Components.classes;
6 const Ci = Components.interfaces;
7 const Cr = Components.results;
9 const DESCRIPTION =
"mashTape Provider: Hype Machine Provider";
10 const CID =
"{ad43af30-7a1c-11dd-ad8b-0800200c9a66}";
11 const CONTRACTID =
"@songbirdnest.com/mashTape/provider/rss/HypeM;1";
15 this.wrappedJSObject =
this;
16 Components.utils.import(
"resource://mashtape/mtUtils.jsm");
25 Ci.sbIMashTapeProvider]),
27 providerName:
"Hype Machine",
28 providerUrl:
"http://hypem.com",
30 providerIcon:
"chrome://mashtape/content/tabs/hypem.png",
32 query:
function(searchTerms, updateFn) {
33 var req =
Cc[
"@mozilla.org/xmlextras/xmlhttprequest;1"]
34 .createInstance(
Ci.nsIXMLHttpRequest);
35 var
url =
"http://hypem.com/feed/search/" + searchTerms +
"/1/feed.xml";
36 mtUtils.log(
"HypeM",
"URL:" + url);
37 req.open(
"GET", url,
true);
39 req.updateFn = updateFn;
40 req.onreadystatechange =
function() {
41 if (this.readyState != 4)
43 if (this.status == 200) {
44 var x =
new XML(this.responseText.replace(
45 /<\?xml
version=
"1.0" encoding=
"[uU][tT][fF]-8"\?>/,
""));
47 var results =
new Array();
48 for each (var
entry in x..item) {
51 time: Date.parse(entry.pubDate),
52 provider: this.provider.providerName,
53 providerUrl: this.provider.providerUrl,
55 content: entry.description,
60 results.wrappedJSObject = results;
61 this.updateFn.wrappedJSObject.update(
CONTRACTID, results);
62 }
else if (this.status == 404) {
72 return XPCOMUtils.generateModule([
HypeM]);
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
sbOSDControlService prototype QueryInterface
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
function NSGetModule(compMgr, fileSpec)
sbDeviceFirmwareAutoCheckForUpdate prototype classID