Created
October 20, 2017 02:14
-
-
Save Scrxtchy/5a894d227a866614b7a12e5ca5008b92 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ini_set("allow_url_fopen", "On"); | |
| $repo = $_GET["repo"]; | |
| $config = 'Configuration: ' .$_GET["conf"]; | |
| $platform = 'Platform: ' .$_GET['plat']; | |
| $response = file_get_contents("http://ci.appveyor.com/api/projects/" . $repo); | |
| $builds = (json_decode($response)->{"build"}->{"jobs"}); | |
| foreach ($builds as &$build) { | |
| if ($build->{"name"} == $config | $build->{"name"} == $platform) { | |
| if ($build->{"artifactsCount"} > 1){ | |
| header('Location: https://ci.appveyor.com/project/ShareX/sharex/build/job/'. $build->{"jobId"} .'/artifacts' ); | |
| } else { | |
| $artifacts = json_decode(file_get_contents('http://ci.appveyor.com/api/buildjobs/'. $build->{"jobId"}.'/artifacts')); | |
| header('Location: https://ci.appveyor.com/api/buildjobs/'. $build->{"jobId"}.'/artifacts/'. $artifacts[0]->{"fileName"}); | |
| } | |
| } | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment