![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Expert Programmer
|
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. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
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.
|
|
|
|
|
|
#3 |
|
Professional Programmer
|
RSS is definately your best bet. Forget the ping bit because I don't think that's even possible.
|
|
|
|
|
|
#4 |
|
Expert Programmer
|
Thanks, I'll look into using RSS.
|
|
|
|
|
|
#5 |
|
Expert Programmer
|
|
|
|
|
|
|
#6 |
|
Hobbyist Programmer
Join Date: Sep 2004
Posts: 207
Rep Power: 5
![]() |
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 |
|
|
|
|
|
#7 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
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;
}Alternatively, use a RSS combining website to create a new combination RSS feed and integrate that into your site. |
|
|
|
|
|
#8 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Be sure to implement caching.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#9 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
|
|
|
|
|
|
|
#10 |
|
Expert Programmer
|
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.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|