View Single Post
Old 04-20-2010, 06:09 AM  
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,349
Turning your blog into a tube site

Today I'll explain how to turn your WordPress blog into a full-featured auto-updating tube site by means of CyberSEO Suite.

Tube-Blog

First of all we have to choose the appropriate blog theme. I suggest freeware Free WordPress Tube theme which is very popular. Let's download it and install at your blog.

Now let's read the documentation:
Quote:
Type the title and text, choose the categories. Than go below and add these custom fields:

1. thumb - URL to the small picture of the video in the home page. Size for this template is 156x103 (you can put up a bigger image, it will fit in automaticly, but it will take longer to load)
2. duration - Duration of the video. Example: 4:55
3. paysite_url - URL of the Pay Site for single page. Example: http://www.google.com
4. paysite_title - Title of the Pay Site for single page
5. video_code - Code of the video for single page (you can embed videos from other sites or host your own player, such as JW Player from http://www.longtailvideo.com)

If you don't want to have any link to paysite, you can leave it out. Also check out Tube Theme options on the bottom of the menu. You can set how many videos appear on the front page by setting the number in Settings/Reading.
As we can see, this theme makes our blog look like a tube site. However we have one small problem there. All these tube-like posts must be composed and published manually which is absolutely unacceptable because we want to have an auto updating tube site which will be able to parse at least standard XML FLV feeds in Smart Tube format. This is why we need CyberSEO Suite with its unlimited abilities to parse custom XML tags, create custom WP post fields and pre-process the aggregating posts.

So, let's take some XML feed, e.g.: http://hostave4.net/rp/hfv/xml_feed_62.xml and syndicate it with CyberSEO Suite. Set up the necessary parameters on the "RSS Feed Syndicator" page, such as post categories, post tags, update frequency, set "Use syndication date" in the "Base date" field etc.

Now we have to follow the instruction of Free WordPress Tube theme about custom fields. Thus we have to put the following text into the "Custom Fields" box:

Code:
screen_url::screen_url 
screen::screen 
clip_url::clip_url 
flv::flv 
duration::duration
Each left argument is the name of XML tag and the right one is the name of custom field of WP post where the contents of mentioned tag must go to.

As far as we know, the FLX XML files of Smart Tube format have no link to paysite, they store the duration of clip in seconds but not in mm:ss format, and even have no FLV code which is required by Free WordPress Tube theme. So we need to write a special PHP code which will fix all the mentioned problems in aggregating posts. Move to the "PHP Code <?php .. ?>" field and put the following PHP code there:

PHP Code:
// put the affiliate link to paysite into the 'paysite_url' custom field according to Free WordPress Tube doc
$post ['custom_fields'] ['paysite_url'] = 'http://www.ropeporn.com/index.html?id=XXX'
// format clip's duration as mm:ss
$post ['custom_fields'] ['duration'] = date 'i:s'$post ['custom_fields'] ['duration'] ); 
// create an URL of thumb from it's path and filename
$post ['custom_fields'] ['thumb'] = $post ['custom_fields'] ['screen_url'] . $post ['custom_fields'] ['screen']; 
// put site name into the "paysite_title" custom field according to Free WordPress Tube doc
$post ['custom_fields'] ['paysite_title'] = 'Rope Porn'
// since FLV videos have no uniqui GUID's let's use their URL's as post GUID's  
$post ['guid'] = $post ['custom_fields'] ['clip_url'] . $post ['custom_fields'] ['flv']; 
// now the most complex part. we have to create the FLV player code, assuming that our FLV player is stored as flvplayer.swf in the root dir of the blog
$post ['custom_fields'] ['video_code'] = '<object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="700" height="544"> 
<param name="movie" value="/flvplayer.swf" /> 
<param name="allowfullscreen" value="true" /> 
<param name="allowscriptaccess" value="always" /> 
<param name="flashvars" value="file='
.$post ['guid'].'&image='.$post ['custom_fields'] ['thumb'].'&autostart=false&linkfromdisplay=true&link='.$post ['custom_fields'] ['paysite_url'].'" /> <object type="application/x-shockwave-flash" data="/flvplayer.swf" width="700" height="544"> 
<param name="movie" value="'
.$post ['guid'].'" /> 
<param name="link" value="'
.$post ['custom_fields'] ['paysite_url'].'" /> 
<param name="allowfullscreen" value="true" /> 
<param name="linkfromdisplay" value="true" /> 
<param name="allowscriptaccess" value="always" /> 
<param name="flashvars" value="file='
.$post ['guid'].'&image='.$post ['custom_fields'] ['thumb'].'&autostart=false&linkfromdisplay=true&link='.$post ['custom_fields'] ['paysite_url'].'" /> <p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p> 
</object> 
</object>'

// not let's delete all useless custom fields 
unset ( $post ['custom_fields'] ['screen_url'] ); 
unset ( 
$post ['custom_fields'] ['screen'] ); 
unset ( 
$post ['custom_fields'] ['clip_url'] ); 
unset ( 
$post ['custom_fields'] ['flv'] ); 
If you are not familiar with PHP, you may not understand the code above, however it's very simple (especially with my comments there ;))

Now save the feed options and relax while the CyberSEO Suite syndicates the given XML file and updates our tube blog with synonymized content automatically. Fire and forget!


Have a nice day
__________________
Obey the Cowgod
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote