Skip to content

Instantly share code, notes, and snippets.

@halgatewood
Created March 4, 2014 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halgatewood/9351625 to your computer and use it in GitHub Desktop.
Save halgatewood/9351625 to your computer and use it in GitHub Desktop.
Get Vine Thumbnails through the open-graph meta tags
function get_vine_thumbnail( $id )
{
$vine = file_get_contents("http://vine.co/v/{$id}");
preg_match('/property="og:image" content="(.*?)"/', $vine, $matches);
return ($matches[1]) ? $matches[1] : false;
}
echo get_vine_thumbnail('bv5ZeQjY352');
@saadicamacho
Copy link

don't work

@Helmitonlins
Copy link

Helmitonlins commented Aug 2, 2018

function get_vine_thumbnail($id)
{
$vine = file_get_contents($id);
preg_match('/property="og:image" content="(.*?)"/', $vine, $matches);
return ($matches[1]) ? $matches[1] : false;
}

$url = 'http://ovnihoje.com/2018/08/02/misterioso-mineral-e-descoberto-em-meteorito/';
$testURL = get_vine_thumbnail($url);

var_dump($testURL);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment