Created
February 6, 2013 02:41
-
-
Save MatthaeusHarris/4719779 to your computer and use it in GitHub Desktop.
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
app.get("/gamevil/privacy", function(req, res) { | |
if (cache.privacy && cache.privacy.timestamp > moment().unix() - 3600) { | |
res.end(cache.privacy.data); | |
} else { | |
cache.privacy = {"timestamp": moment().unix()}; | |
http.get("http://us.gamevil.com/news.php?m=policy", function(r) { | |
var page = ""; | |
r.on('data', function(chunk) { | |
page += chunk; | |
}); | |
r.on('end', function() { | |
cache.privacy.data = $(page).find("#sub_contents").html(); | |
res.end(cache.privacy.data); | |
}); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Find the WTF!