Skip to content

Instantly share code, notes, and snippets.

@necenzurat
Created March 12, 2014 22:14
Show Gist options
  • Save necenzurat/9517605 to your computer and use it in GitHub Desktop.
Save necenzurat/9517605 to your computer and use it in GitHub Desktop.
<?php
//https://gdata.youtube.com/feeds/api/videos?v=2&alt=jsonc&q=oregon%20trail%20hack&max-results=50
for ($i=1; $i <10100 ; $i++) {
$query = urlencode("World At Arms hack");
$u2b = json_decode(file_get_contents("http://gdata.youtube.com/feeds/api/videos?v=2&alt=jsonc&q=$query&max-results=10&start-index=$i"), true);
print chr(13)."doing page $i";
if ($u2b["data"]["items"] != 0){
foreach ($u2b["data"]["items"] as $video)
$current = $video["title"].",". $video["player"]["default"]. "\n";
file_put_contents("woa.txt", $current,FILE_APPEND);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment