Skip to content

Instantly share code, notes, and snippets.

@alexdelany
Created February 25, 2013 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexdelany/5032602 to your computer and use it in GitHub Desktop.
Save alexdelany/5032602 to your computer and use it in GitHub Desktop.
var vids = _.keys(this.queue)
for (i = 0;i<vids.length;i+= 50){
options = {
host: 'www.googleapis.com',
path: "/youtube/v3/videos?id="
+ vids.slice(i,i+50).join(",")
+ "&part=statistics&fields=items&key="
+ "AIzaSyBzaqm6tPr9knyq7uNYrEjIouMUvCave10" // api key
}
var queryResponse = ''
https.get(options, function(response) {
console.log("Got response: " + response.statusCode + "\2" + " : i = " + i)
response.on('data', function(chunk){
queryResponse += chunk
})
response.on('end', function(){
var results = JSON.parse(queryResponse)
console.log("\n"+results.items.length+" RESULTS PARSED FROM YOUTUBE\n")
})
})
}
})
@bluntpeak
Copy link

var makerequest = function(options) {
https.get......

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment