Skip to content

Instantly share code, notes, and snippets.

@niclashoyer
Created June 15, 2012 20:50
Show Gist options
  • Save niclashoyer/2938635 to your computer and use it in GitHub Desktop.
Save niclashoyer/2938635 to your computer and use it in GitHub Desktop.
Get Tags of a GitHub Repository with links to Tarballs
#!/usr/bin/env php
<?php
$user = 'symfony';
$repo = 'symfony';
$url = 'https://api.github.com/repos/'.$user.'/'.$repo.'/tags';
$json = file_get_contents($url);
$tags = json_decode($json);
foreach($tags as $tag) {
echo $tag->name."\t".$tag->tarball_url."\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment