Skip to content

Instantly share code, notes, and snippets.

@nedcampion
Forked from alexdelany/gist:4624400
Last active December 11, 2015 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nedcampion/4625073 to your computer and use it in GitHub Desktop.
Save nedcampion/4625073 to your computer and use it in GitHub Desktop.
request = function(url, func ){
setTimeout(function(){
console.log("REQUEST", url, func);
func();
}, 1);
}
function Source(url){
this.url = url;
this.morelinks = ['NO CHANGE'];
var self = this;
this.calculate = function(url){
console.log("Calculating: " + self.url);
console.log('1: ' + self.morelinks)
var parse = function(err,resp,body){
console.log('3: ' + self.morelinks)
self.morelinks.push("ADDED ONE");
}
request(self.url, parse);
console.log('4: ' + myResults.morelinks)
}
}
myResults = new Source('http://www.reddit.com/r/videos');
myResults.calculate();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment