Created
May 9, 2012 00:10
-
-
Save suth/2640615 to your computer and use it in GitHub Desktop.
Facebook Thumbnail Class
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
class Facebook_Thumbnails extends Video_Thumbnails_Providers { | |
// Regex strings | |
public $regexes = array( | |
'#"http://www.facebook.com/v/([0-9]+)"#' // Facebook Embed | |
); | |
// Thumbnail URL | |
public function get_thumbnail_url( $id ) { | |
return 'https://graph.facebook.com/' . $id . '/picture'; | |
} | |
// Test cases | |
public $test_cases = array( | |
array( | |
'markup' => '<object width=420 height=180><param name=allowfullscreen value=true></param><param name=allowscriptaccess value=always></param><param name=movie value="http://www.facebook.com/v/2560032632599"></param><embed src="http://www.facebook.com/v/2560032632599" type="application/x-shockwave-flash" allowscriptaccess=always allowfullscreen=true width=420 height=180></embed></object>', | |
'expected' => 'https://graph.facebook.com/2560032632599/picture', | |
'name' => 'Facebook' | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment