Skip to content

Instantly share code, notes, and snippets.

@ifarbod
Created November 11, 2016 19:11
Show Gist options
  • Save ifarbod/43c233d3b6d2f9d56309c5dd03ea53ae to your computer and use it in GitHub Desktop.
Save ifarbod/43c233d3b6d2f9d56309c5dd03ea53ae to your computer and use it in GitHub Desktop.
<?php
$doc = file_get_contents('http://opensource.spotify.com/cefbuilds/index.html');
$pattern = '/href="cef_binary_[0-9].[0-9]+.[0-9]+.[a-zA-Z0-9]+_windows32_minimal.tar.bz2"/';
$cefpath = 'http://opensource.spotify.com/cefbuilds/';
preg_match($pattern, $doc, $matches);
$cefbuildnum = $matches[0];
$cefbz = substr($cefbuildnum, 6, strlen($cefbuildnum) - 7);
$finalPath = $cefpath . $cefbz;
header('Location: ' . $finalPath);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment