The New List
Sweet… Sooo I think I spent well over 12 hours on this part of the project so far… You can view the output of the script here… I’m using MagpieRSS to fetch the feeds & PHP with MYSQL to use the database for the urls to the feeds.
I tried using MeshRSS, LastRSS and a few other scripts to fetch the feeds before. The problem was that they would either take forever to return the feeds or time out because of the number of feeds in the database.
If you do some research on Magpie everyone says that it works very well compared to the others… I’ll agree to that much but there were a few things that I didn’t like… one of them is the date on the atom feeds. If a blog from blogger.com is rebuilt, so are all of its posts and that’ll be enough to change the modified date for all of the posts.
Or maybe I’m wrong… I’m most probrably wrong but it sure sounds right… hehe…
Anyway… here’s magpie within my php function to fetch for urls….
function getposts(){
$myDB2 = new mySQLClass(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD);
$myDB2->Database = DATABASE_NAME;
$myDB2->SelectDB();
$query2 = “get urls”;
$myDB2->Query = $query2;
$myDB2->Execute();
$cont=0;
while(!$myDB2->EOF && $myDB2->RecordCount > 0)
{
$myDB2->Fetch();
$row = $myDB2->Row;
$cont++;$urlrdf = $row['urlrdf'];
if ($urlrdf != “”)
{
$rss = fetch_rss( $urlrdf );
echo “<p>Blog: ” . $rss->channel['title'] . “</p>”;foreach ($rss->items as $item)
{
$href = $item['link'];
$title = $item['title'];
$in_date = “”;
$rss_2_date = $item['pubdate'];
$rss_1_date = $item['dc']['date'];
$atom_date = $item['modified'];
if ($atom_date != “”) $in_date = parse_w3cdtf($atom_date);
if ($rss_1_date != “”) $in_date = parse_w3cdtf($rss_1_date);
if ($rss_2_date != “”) $in_date = strtotime($rss_2_date);
if ($in_date == “”) $in_date = time();
$post_date = date(“F d, Y”, $in_date);
echo “<li>$post_date – <a href=$href&rt;$title</a></li>”;
}
}
}
$myDB2->FreeRecordset();
}
So that will soon be a new format for displaying the list of updated blogs on Blogs Dominicanos. I don’t think I’ll completely eliminate the ping form or the list for manual pings but this should be a nice addition once it is complete.
A few more things… cache is turned on and I will only use magpie to display all of the blogs with a valid feed. I have either erased blogs that no longer exist or disabled the blogs that do not have valid feeds. For those of you that publish You Tube videos on your blogs, some of your coding is wrong and your feeds do not validate (or You Tube’s coding is wron and they need to correct it for proper validation). After I publish the feed on the main page and you don’t see your blog on the updated list, login to the registration form, check your feed url, update it if need be and I will double check it once you have done so… OK… I hope thats it for now… I have to be at work by 9… I have to interview a candidate for the maintaince dept.
Cheers!
- Update – I’ve added the full code to the function… Alex, copy and paste is soo easy…
Loco, eso está mortal’. Por más que trato de meterle mano al PHP no paso de un cut N paste.
, creo que me quedo con mis redes mejor.
Oye nos tenemos que comunicar, tengo un par de questions pa’ ti.
Oye, gracias por todo ese trabajo que haces. No tengo la menos idea de que se trata el codigo ese que esta pusiste, pero lo que sea que es … cool..
ciao.