Pulling Blip links for storing in Embedded Media Field
| Project: | MM BlipTV |
| Version: | 5.x-0.1 |
| Component: | User interface |
| Category: | support request |
| Priority: | normal |
| Assigned: | agaric |
| Status: | active |
Jump to:
I've been testing this module out for the ability to pull newly created Blip links in order to store them in a CCK Embedded Media Field. I thought this module could do that but it is not clear to my how to configure it to do so - that is if it could ever do this at all.
This is my understanding so far:
Its like there is missing link at the end of the Media Mover process. I created a custom content type with both a Video Media Field and a Blip Emfield. I find the four steps in Media Mover should look like this:
Harvest - On cron, "harvest file from upload field" assuming I am using the upload module to attach video files.
Process - Nothing, not necessary for this example I suppose.
Storage - With mm_bliptv, "move file to blip.tv service" which involves making a connection with a Blip.tv account and uploading the file.
Complete - This is the missing link. With only the Media Mover and mm_bliptv installed there seems to be no method for capturing the original-URL of the new Blip post with the mm_bliptv module. Seems like work needs to be done to the module to make this possible, unless I am just missing something.
How do I return the blip post address back to something like emfield on the complete stage?

#1
The second call to _mm_bliptv_send() is quite redundant. Instead, something like this is needed to get the blip.tv embed code. (Does anyone know how to actually use &%*&$ xpath?)
We're doing this hackily in the theme layer for now, but something like it should work in a module:
<?php
$url = $node->media_mover[1][0]['storage_file'];
$rss = file_get_contents($url .'?skin=rss');
// print $rss;
if (!$rss) break;
// $xml = new SimpleXMLElement($rss);
// $xml = simplexml_load_file($rss);
// $xml->register_ns('rss', 'http://purl.org/rss/1.0/');
/* Search for <blip:embedLookup> */
// $embed = $xml->xpath('/rss/channel/item');
// drupal_set_message('<pre>'. var_export($embed,TRUE) .'</pre>');
$needle = '<blip:embedLookup>';
$needle_length = 18; // strlen($needle);
// will it always be 7 characters? k2mqri8
// if not we'll need to use a regular expression
$needle2 = '</blip:embedLookup>';
// we know there's a lot of unnecessary stuff in the rss file
// so we can skip the first 2,200 characters or so
$loc = strpos($rss, $needle, 200);
$loc = $loc + $needle_length;
$needle2 = '</blip:embedLookup>';
$loc2 = strpos($rss, $needle2, $loc);
$length = $loc2 - $loc;
$embed = substr($rss, $loc, $length);
$output = '<embed src="http://blip.tv/play/' . $embed . '" type="application/x-shockwave-flash" width="350" height="293" allowscriptaccess="always" allowfullscreen="true" />';
// $embed = $xml->xpath('/rss/channel/item/media:player');
// drupal_set_message('<pre>'. var_export($embed,TRUE) .'</pre>');
// $output = $embed;
print $output;
?>
benjamin, Agaric Design Collective