View Single Post
Old 08-01-2011, 07:23 AM  
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,381
Using Yahoo! Babel Fish with CyberSEO

1) Simple syndicate the feed you are going to pull posts from.
2) Put the following code into the “PHP Code <?php .. ?>” box:
Code:
// 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 );
3) Save the settings and pull the feed. Done!

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.
__________________
Obey the Cowgod

Last edited by just a punk; 08-01-2011 at 07:25 AM..
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote