Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 14th, 2006, 12:02 AM   #1
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 930
Rep Power: 4 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Combine blogs on one page?

My friend and I run a website for Mac users. The content is powered by pMachine. Due to a dearth of talented writers, we have decided that it would be great if we could set up a system such that when one of a select group of people posts an article to their Wordpress-powered blog, the headline of that article would show up on the main website's homepage. It would be possible but undesirable to host these blogs on the same server as the main site. I would like to know if anyone has an idea of how to go about this.

I know whenever one posts an article in Wordpress it can ping a server (such as rpc.pingomatic.com or similar). Is it possible to write a PHP script to intercept such a ping? If so, how? If I choose to solve the problem in this way, how could I prevent a post from showing up twice (if the poster clicked "Post" twice, etc.)? Should the headlines be stored in a cached file on the server? Is there a better way to go about this?

Thanks for the input.
titaniumdecoy is online now   Reply With Quote
Old Apr 14th, 2006, 5:59 AM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
It seems to me that RSS would be good for the job. Presumable, Wordpress supports RSS, so you could use something like MagpieRSS to parse the RSS data.
Arevos is offline   Reply With Quote
Old Apr 14th, 2006, 9:54 AM   #3
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
RSS is definately your best bet. Forget the ping bit because I don't think that's even possible.
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Apr 14th, 2006, 1:47 PM   #4
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 930
Rep Power: 4 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Thanks, I'll look into using RSS.
titaniumdecoy is online now   Reply With Quote
Old Apr 15th, 2006, 2:03 PM   #5
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 930
Rep Power: 4 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Can anyone recommend a free PHP script that will read multiple RSS feeds and combine them sorted by date? Or do I have to write this myself? I'm trying to do something like this or this.
titaniumdecoy is online now   Reply With Quote
Old Apr 15th, 2006, 2:59 PM   #6
BlazingWolf
Hobbyist Programmer
 
Join Date: Sep 2004
Posts: 207
Rep Power: 5 BlazingWolf is on a distinguished road
Best bet would be to do it yourself thats quite a niche script.

Just parse the feeds throw them into a database and sort by date.

Might require a cron job or something so that it is only update once a day, or someway to check if a certain post has already been put into the database.
__________________
_______________________________
BlazingWolf
BlazingWolf is offline   Reply With Quote
Old Apr 15th, 2006, 5:48 PM   #7
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
It wouldn't take too long to knock a script like that up. With the Magpie RSS library, for instance:
class Article {
    var $title;
    var $date;
}
$articles = array();

$rss = fetch_rss("http://some.url");
foreach ($rss->items as $item) {
    $article = new Article;
    $article->title = $item['title'];
    $article->date = parse_w3cdtf($item['dc']['date']);
    $articles[] = article;
}
I confess my PHP knowledge of classes is a little rusty, so there may be errors in my example, but I hope that gives a starting point. Once you have arrays of all your feeds, it should be relatively easy to combine and sort them.

Alternatively, use a RSS combining website to create a new combination RSS feed and integrate that into your site.
Arevos is offline   Reply With Quote
Old Apr 15th, 2006, 9:55 PM   #8
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Be sure to implement caching.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Apr 16th, 2006, 4:51 AM   #9
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by Dameon
Be sure to implement caching.
Magpie automatically caches feeds for an hour, I believe. Though the time it caches can be varied.
Arevos is offline   Reply With Quote
Old Apr 15th, 2006, 10:13 PM   #10
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 930
Rep Power: 4 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
I'm not very familiar with objects or arrays in PHP. If I have a string $text which contains the string I want to display and a separate variable $date which stores the time as a string, how can I associate the two variables? And once I have an array of these objects/arrays, how can I sort them by $date? Thanks for the help.
titaniumdecoy is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:48 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC