Created
December 26, 2013 12:27
-
-
Save smikes/8133234 to your computer and use it in GitHub Desktop.
cached request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rssResults; | |
function fetchRSSResults() { | |
/* queue up a re-get in 15 minutes */ | |
setTimeout(fetchRSSResults, 15*60*1000); | |
http.get(url...); | |
// parse the rss | |
rssResults = result; | |
return rssResults; | |
} | |
exports.getRSS = function () { | |
if( !rssResults ) { | |
return fetchRSSResults(); | |
} | |
return rssResults; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.getRSS = function () { /* return rss results */ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment