Created
March 4, 2014 17:38
-
-
Save halgatewood/9351625 to your computer and use it in GitHub Desktop.
Get Vine Thumbnails through the open-graph meta tags
This file contains 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
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'); |
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
don't work