I´m building a website in different languages but the content is the same, provided by an external video site, the video, title and preview images must be the same, only description will be translated, I´m using the script bellow to auto-post to my other blog from video RSS feed, but it´s hard to customize it.
Code: Select all
<?php
//Your Blog’s Keyword:
$keyword = “keyword”;
//How many articles do you want to grab each time?
$num = 5;
//Get the RSS Feed - In this instance, we’re using a google blogsearch feed based on our chosen keyword
$feed = simplexml_load_file(”http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&q=” .urlencode($keyword). “&ie=utf-8&num=10&output=rss”);
//Loop through our keywords
foreach ($feed->channel->item as $item) {
if($i < $num){
//Have a bit of a rest so we’re not posting too fast to our blogger blog
sleep(10);
$title = $item->title;
$title = str_replace(”<b>”, “”, $title);
$subject = str_replace(”</b>”, “”, $title);
$link = $item->link;
$description = $item->description;
$description = str_replace(”<b>”, “”, $description);
$body = str_replace(”</b>”, “”, $description);
//put our secret blogger email address here:
$to = “accountname.password@blogger.com”;
//ignore this line - the script just needs something in the “From” field.
$headers = ‘From: mail@whatever.com’;
//Send the email / How’d we go?
if(mail($to, $subject, $body, $headers)) {
echo $subject. ” - sent<br>”;
}
else
{
echo $subject. ” - NOT sent<br>”;
}
}
//add one to our counter
$i++;
}
?>* Is it possible to use some strings from $link of rss to print other preview images ? - I mean... in rss there´s only one preview image (eg: <IMG SRC="http://video.user.com/1234/photo/1.jpg />) but in fact there´re 10 preview images, so I want the script to use taht url but change the strings (123) and (photo) based on url given on rss feed of each feed loaded.
* Is it possible to prevent the double post ?... because the videos are in different categories and it´s not updated daily on all categories, so it keep posting the same feed and it´s boring, I would like to prevent script from posting the same feed.
Thanks in advance for your help !