Skip to content

Instantly share code, notes, and snippets.

@ISTweak
Created November 27, 2013 14:50
Show Gist options
  • Save ISTweak/7676903 to your computer and use it in GitHub Desktop.
Save ISTweak/7676903 to your computer and use it in GitHub Desktop.
パッチ取ってくる
<?php
$url = 'https://github.com/ISTweak/android_kernel_sharp_is05/commits/master';
set_time_limit(0);
foreach ( file($url) as $read ) {
if ( strpos($read, 'class="message"') !== false ) {
if ( preg_match('/.+<?\shref=[\'|"](.*?)[\'|"].*?>(.*?)<\/a>/', $read, $link) ) {
file_put_contents($link[2].'.patch', file_get_contents('https://github.com'.$link[1].'.patch'));
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment