videoCast PHP Parser

| | Comments (0) | TrackBacks (0)

Well, here I am again, with a working parser that might be helpful for your development, especially if you are looking for a youtube link parser.

What is this?

videoCast PHP Parser is a pretty simple class that helps you parse links like http://vimeo.com/613460 into an embedded HTML. It supports Youtube, Dailymotion (permalinks only), Metacafe, Revver and vimeo.

How to use?

This is the easy part. Upload the parser to your site and in your php file.

require_once 'viCastPHP.php';

$parseVideos = new viCastPHP();
$parseVideos->getFormat($_POST['text']); // You will need to change this and adapt it to your needs

Another way of using this parser is

$parseVideos->limitParse(3)->excludeSites(array('youtube','metacafe'))->getFormat($_POST);
or
$parseVideos->limitParse(3)->getFormat($_POST);

getFormat must be called last for it to take effect of the changes.

excludeSites() only accepts arrays or a plain string.Right now the strings you may put in the array or string are only: "youtube","dailymotion","revver","vimeo","metacafe".

limitParse() only limits # for each pattern. (I'm thinking of extending this but that depends now)

What was this for?

I created this for learning purpose for both PHP5 OOP and Regular Expressions. I thought I'd share it with you guys :).

Get the parser NOW!

0 TrackBacks

Listed below are links to blogs that reference this entry: videoCast PHP Parser.

TrackBack URL for this entry: http://routecafe.com/cgi-bin/dashboard/mt-tb.cgi/19

Leave a comment

About this Entry

This page contains a single entry by David published on August 3, 2008 8:10 PM.

Fooling around with regex was the previous entry in this blog.

Lights out is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.1