View Single Post
Old 12-02-2007, 05:25 PM  
mryellow
Confirmed User
 
Industry Role:
Join Date: May 2001
Location: Australia
Posts: 934
The locking down of content as hotlinkable is up to sponsors, this feed just
gives them a syndication method. I would however imagine sponsors going
down the path of allowing hotlinking, it makes business sense for everyone
involved really. Your script should probably hit movies with a HEAD request to
test if they are hotlinkable before including in database. However at this
stage I don't think it will matter as I believe any sponsor partisipating in this
kind of feed format will allow hotlinking.

Do you have a Atom parser for perl? I can code you up something to take
this feed and spit out an associated array if needbe. Got one for PHP already,
perl wouldn't take long.

Most of what you need to be concerned with is the titles of the links, finding
the images that match the movies (thumbnails), and extracting the 2257 and
affiliate links.

Here is the main bit of logic from my phpMotion importer, it's probably a little
strict in that it checks content types, titles, etc when in some cases it
doesn't need to doublecheck all that.

Code:
foreach ($entry->links as $link) {
	if ($link['title'] == "2257") {
		$location_recorded = $link['href'];
	} else if ($link['type'] == "video/x-flv" && $link['rel']=="enclosure") {
		$video_length = $link['length'];
		$video_length = sec2time($video_length);
		if ($video_length["minutes"]>0) {
			$video_length = $video_length["minutes"]."m ".$video_length["seconds"]."s";
		} else {
			$video_length = $video_length["seconds"]."s";
		}
		$video_url = $link['href'];
		$video_title = $link['title'];
	} else if ($link['type'] == "text/html" && $link['rel']=="alternate") {
		$sponsor_url = $link['href'];
		$sponsor_title = $link['title'];
	} else if (preg_match('/.*Buy DVD.*/i',$link['title']) && $buy_url=='' && $link['type'] == "text/html" && $link['rel']=="related") {
		$buy_url = $link['href'];
	}
}

foreach ($entry->links as $link) {
	if ("image[".$video_title."]" == $link['title'] && $link['type'] == "image/jpeg" && $link['rel']=="related") {
		$thumb_url = $link['href'];
	}
}
-Ben
__________________
Cyberwurx Hosting
After trying 5 different hosts, I found the best.
Since 1997 I've had 2 hours of downtime.
Fast support, great techs, no hype, no gimmicks.

<- I in no way endorse whatever just got stuck on the left of my post.
mryellow is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote