Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // URLs of targets
- $baseUrl['rb'] = 'http://ci.bukkit.org/job/dev-CraftBukkit/Recommended/artifact/target/';
- $baseUrl['edge'] = 'http://ci.bukkit.org/job/dev-CraftBukkit/lastSuccessfulBuild/artifact/target/';
- // Config options
- $defTarget = 'rb';
- /* Code */
- $target = $defTarget;
- if (isset($_GET['edge'])) $target = 'edge';
- $fh = fopen($baseUrl[$target], 'r');
- if (!$fh) {
- notFound();
- }
- while (!feof($fh)) {
- $line = fgets($fh);
- if (strpos($line, 'fileList') !== false) {
- $uStart = strpos($line, '<a href="') + 9;
- $uEnd = strpos($line, '">', $uStart);
- $url = substr($line, $uStart, $uEnd - $uStart);
- break;
- }
- }
- fclose($fh);
- if (isset($url)) {
- header('Location: '.$baseUrl[$target].$url);
- } else {
- notFound();
- }
- function notFound() {
- header('HTTP/1.0 404 Not Found');
- die();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement