Getting a thumbnail for an external video as the thumbnail for a custom post type?

You can use the Blip TV API:

http://wiki.blip.tv/index.php/Blip.tv_API

Look for “How do I find the thumbnail for an item?”
Examples of the API can be found in the wiki e.g. the PHP Example:

include_once("blipPHP.php");
$blipPHP = new blipPHP("username", "password");
$respond = $blipPHP->info(4794325);

returns a LONG array. Inside this you find:

[3] => SimpleXMLElement Object
                                    (
                                        [@attributes] => Array
                                            (
                                                [rel] => alternate
                                                [type] => application/rss+xml
                                                [href] => http://blip.tv/rss/4812438
                                            )

                                    )

Now make a call to get http://blip.tv/rss/4812438 (you can check this one in your browser)

And you can parse the returned content for the thumnail as in the xpath expression given as you find:

<media:thumbnail url="http://a.images.blip.tv/Oldjewstellingjokes-AdrianeBergPastorFuzz165.jpg"/>

Now… maybe you have some questions:

1 how do i program something to get a url (URI) in a string?

WordPress provides a default method for that: wp_remote_get : READ: http://codex.wordpress.org/HTTP_API (see also http://core.trac.wordpress.org/ticket/4779)

2 Ok… now I have some website in a string what do i do with it?

Whatever you can think of, if it is stuff that is not “XML” related you will probably use smart regex to parse the content out of the string. (see php regex)

But…. to make stuff more readable for yourself, read the string in a DOM and then use XPath to quickly scan for the content. (see google:xpath or php.net: xpath)

$dom = new DOMDocument();
libxml_use_internal_errors(true);
$dom->strictErrorChecking = false;
if (!$dom->loadHTML($data)) 
{
   foreach (libxml_get_errors() as $error) 
   {
     //     handle errors here
    }
    libxml_clear_errors();      
} 
else
{
   $xpath = new DOMXPath($dom);
   $elements = $xpath->query('/rss/channel/item/media:thumbnail/@url');

TADA!
the thumbnail we found: