Professional Autoblogging and Spinning Plugin for WordPress
Examples
Syndicating YouTube Videos
1) Syndicate the YouTube feed (e.g. http://gdata.youtube.com/feeds/base/videos?q=Music).
2) Put the following code into the “PHP Code <?php .. ?>” box:
// assign preferred width and height of youtube video $width = 450; $height = 375; // make sure the feed has the <content> tag. If not, use <description> if ($post ['post_content'] == '') { $post ['post_content'] = $post ['post_excerpt']; } // extract youtube clip id preg_match ( "/www.youtube.com\/watch\?v=(.*?)[&|\"]/s", $post ['post_content'], $matches ); $clip_id = $matches [1]; // create youtube player code and insert the extracted clip id there $video = "<iframe width=\"$width\" height=\"$height\" src=\"http://www.youtube.com/embed/$clip_id\" frameborder=\"0\" allowfullscreen></iframe>"; // extract the clip description preg_match ( "/<span>(.*?)<\/span>/s", $post ['post_content'], $matches ); $post ['post_content'] = "<p>" . $video . "</p>\n<p>" . $matches [1] . "</p>\n";
3) Save the settings and pull the feed.
Yes it’s that easy ;)
Using Google Translate with CyberSEO
1) Syndicate the new feed.
2) Put the following code into the “PHP Code <?php .. ?>” box:
// Set source language, e.g. English $s = 'en'; // Set destination language, e.g. German $d = 'de'; if ($post['post_content'] == '') { $post['post_content'] = $post['post_excerpt']; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.googleapis.com/language/translate/v2?key=INSERT-YOUR-KEY&source=' . $s . '&target=' . $d . '&q=' . urlencode($post['post_content'])); curl_setopt($ch, CURLOPT_REFERER, 'http://www.yoursite.com/translate.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $json = json_decode(curl_exec($ch), true); $post['post_content'] = $json['data']['translations']['translatedText']; $post['post_excerpt'] = $post['post_content'];
3) Replace INSERT-YOUR-KEY with your Google API key.
4) Save the settings and pull the feed.
The code above has two variables: $s and $d. Use them to set source and destination language for your feed. For example, if you want to translate the Danish feed to Spanish, use the following values:
$s = ‘da’;
$d = ‘es’;
Now you can use the Google Translate to automatically translate the XML and RSS feeds with the CyberSEO autoblogging plugin.
Using Yahoo! Babel Fish with CyberSEO
1) Syndicate the new feed.
2) Put the following code into the “PHP Code <?php .. ?>” box:
// Set source language, e.g. English $s = 'en'; // Set destination language, e.g.: German $d = 'de'; if ($post ['post_content'] == '') { $post ['post_content'] = $post ['post_excerpt']; } $translated = cseo_file_get_contents ( 'http://babelfish.yahoo.com/translate_txt?ei=UTF-8&intl=1&trtext=' . urlencode ( $post ['post_content'] ) . '&lp=' . urlencode ( $s . '_' . $d ) . '&btnTrTxt=Translate' ); $post ['post_content'] = preg_replace ( '/(^.*?<div id="result"><div style="padding:0.6em;">)(.*?)(<\/div>.*?$)/s', "\\2", $translated ); $post ['post_excerpt'] = $post ['post_content'];
3) Save the settings and pull the feed.
The code above has two variables: $s and $d. Use them to set source and destination language for your feed. For example, if you want to translate the Dutch feed to French, use the following values:
$s = ‘nl’;
$d = ‘fr’;
Now you can use the Yahoo! Babel Fish to automatically translate the XML and RSS feeds with the CyberSEO autoblogging plugin.
How To Parse Amazon Feeds
Like many other affiliate programs Amazon also provides RSS feeds to its resellers. In general the Amazon’s tag feed URL’s have a very simple format:
http://www.amazon.com/rss/tag/keyword/new?tag=amazon_tag
http://www.amazon.com/rss/tag/keyword/popular?tag=amazon_tag
http://www.amazon.com/rss/tag/keyword/recent?tag=amazon_tag
The product category based feed URL’s look like this:
http://www.amazon.com/rss/bestsellers/product?tag=amazon_tag
where:
keyword is the product tag (e.g. “sci-fi”, “blu-ray” etc);
product is the product category (e.g. “jewelry”, “software”, “3887251″ etc);
amazon_tag is your Amazon Associate tag which identifies you as an Amazon reseller. It’s used by Amazon to track your sales.
These feeds are delivered in the standard RSS 2.0 format, so you can simple syndicate to your blog “as they are”. E.g.: http://www.amazon.com/rss/bestsellers/3600?tag=your_associate-tag.
Find more info on Amazon RSS feeds at the Amazon Mashups forum.
AMAZON STORE BLOG DEMO
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:
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 156×103 (you can put up a bigger image, it will fit in automatically, 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 various RSS and XML feeds containing FLV content. Fore example let’s findout how to update our Tube site with popular YouTube RSS feeds and XML FLV feeds in Smart Scripts/TubeAce 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.
How to build YouTube RSS Feed powered WordPress tube site
The only thing we have to do, is to parse the desired YouTube RSS feed (e.g.: http://gdata.youtube.com/feeds/base/standardfeeds/top_rated?alt=rss&time=today) and fit it into Free WordPress Tube theme. Actually this is a very easy case. Syndicate the desired YouTube RSS feed with CyberSEO Suite and set up the necessary parameters on the “XML Syndicator” page, such as post categories, post tags, update frequency, set “Use syndication date” in the “Base date” field etc.
Now move to the “PHP Code <?php .. ?>” field and put the following PHP code there:
// assign preferred width and height of youtube video $width = 640; $height = 375; // make sure the feed has the <content> tag. If not, use <description> if ($post ['post_content'] == '') { $post ['post_content'] = $post ['post_excerpt']; } // assign site title $post ['custom_fields'] ['paysite_title'] = "YouTube"; // assign site URL $post ['custom_fields'] ['paysite_url'] = "http://www.youtube.com/"; // extract image thumbnail preg_match ( "/<img(.*?)src=[\'\"](.+?)[\'\"](.*?)>/s", $post ['post_content'], $matches ); $post ['custom_fields'] ['thumb'] = $matches [2]; // uncomment the line below to store thumbnails at your host cseo_store_image ('thumb', $post ['post_title']); // extract clip duration preg_match ( "/<span(.*?)>(\d+:\d+)<\/span>/s", $post ['post_content'], $matches ); $post ['custom_fields'] ['duration'] = $matches [2]; // extract youtube clip id preg_match ( "/youtube.com\/watch\?v=(.*?)[&|\"]/s", $post ['post_content'], $matches ); $clip_id = $matches [1]; // create youtube player code and insert the extracted clip id there $post ['custom_fields'] ['video_code'] = "<iframe width=\"$width\" height=\"$height\" src=\"http://www.youtube.com/embed/$clip_id\" frameborder=\"0\" allowfullscreen></iframe>\n"; // extract the clip description preg_match ( "/<span>(.*?)<\/span>/s", $post ['post_content'], $matches ); $post ['post_content'] = $matches [1];
Now save the feed options and let the CyberSEO Suite to aggregate the YouTube RSS feed to update our tube site with synonymized content automatically.
AUTOBLOG TUBE DEMO
How to build Smart Scripts/TubeAce XML Feed powered WordPress tube site
So, let’s take some FLV XML feed in Smart Scripts/TubeAce format and syndicate it with CyberSEO Suite. Set up the necessary parameters on the “XML 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:
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 FLV XML files of Smart Scripts/TubeAce format have no link to site, 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:
// put the site link to paysite into the 'paysite_url' custom field according to Free WordPress Tube doc $post ['custom_fields'] ['paysite_url'] = 'HTTP://WWW.SITE.COM/'; // put site name into the "paysite_title" custom field according to Free WordPress Tube doc $post ['custom_fields'] ['paysite_title'] = 'SITE NAME'; // 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 file name $screen = $post ['custom_fields'] ['screen']; if (is_array ( $screen )) { $post ['custom_fields'] ['thumb'] = $post ['custom_fields'] ['screen_url'] . $screen [rand ( 0, count ( $screen ) - 1 )]; } else { $post ['custom_fields'] ['thumb'] = $post ['custom_fields'] ['screen_url'] . $screen; } // uncomment the line below to store thumbnails on your server // cseo_store_image ('thumb', $post ['post_title']); // since FLV videos have no unique 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 JW Player code, // assuming that the player itself is stored as flvplayer.swf in the root dir of the blog $post ['custom_fields'] ['video_code'] = '<embed flashvars="image=' . $post ['custom_fields'] ['thumb'] . '&file=' . $post ['guid'] . '&link=' . urlencode ( $post ['custom_fields'] ['paysite_url'] ) . '&autostart=true&displayclick=link" width="600" height="466" allowfullscreen="true" allowscripaccess="always" id="flvplayer" name="flvplayer" src="/flvplayer.swf" />'; // now let's delete all unnecessary custom fields unset ( $post ['custom_fields'] ['screen_url'] ); unset ( $post ['custom_fields'] ['screen'] ); unset ( $post ['custom_fields'] ['clip_url'] ); unset ( $post ['custom_fields'] ['flv'] );
The example above is intended to work works with the JW Player by LongTail Video Inc. which is distributed under the Creative Commons License. Download it from the official site and upload into your blog’s root folder as flvplayer.swf.
Now save the feed options and relax while the CyberSEO Suite syndicates the given XML file and updates our WordPress tube site with synonymized content automatically.
Fire and forget!