By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,723 Members | 1,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,723 IT Pros & Developers. It's quick & easy.

code to generate RSS feeds

P: n/a
Hi,

I'm using PHP 4.4.4 with Apache 2.2. I'm looking for recommendations
on free code I can use to generate RSS feeds. I found FeedCreator
though Google, but that is terrible. It cannot output dates correctly
and it displays a bunch of warnings/notices, even though I never
touched their code.

Thanks for your advice, - Dave

Feb 12 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
NC
On Feb 12, 9:21 am, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.comwrote:
>
I'm using PHP 4.4.4 with Apache 2.2. I'm looking for recommendations
on free code I can use to generate RSS feeds. I found FeedCreator
though Google, but that is terrible. It cannot output dates correctly
and it displays a bunch of warnings/notices, even though I never
touched their code.
A few months ago, I posted to alt.php on a simlar topic:

http://groups.google.com/group/alt.p...c1bd3503d5b0f5

If you have any questions after reading that post, shoot me an e-
mail.

Cheers,
NC

Feb 13 '07 #2

P: n/a
la***********@zipmail.com wrote:
I'm using PHP 4.4.4 with Apache 2.2. I'm looking for recommendations
on free code I can use to generate RSS feeds.
Here's the class I use for my current project.
http://svn.sourceforge.net/viewvc/*c...e=text%2Fplain

It's uses PHP 5, but it should be reasonably simple to backport to PHP 4.

Basic technique is:

<?php
require_once 'Feed.class';
$type = 'rss';

$feed = Feed::factory($type);
$feed->title = 'Example';
$feed->url = 'http://example.com/';
$feed->summary = '<p>Here is <b>my</bsite. It is nice.</p>';
$feed->langguage = 'en_GB';
$feed->add_item('Article 1',
'http://example.com/articles/1',
'<p>Article 1 is lovely.</p>');
$feed->add_item('Article 2',
'http://example.com/articles/2',
'<p>Article 2 is even <b>better!</b>.</p>');
$out = $feed->output();

header("Content-Type: text/xml");
print $out;
?>

It supports:

- RSS 0.91
- RSS 1.0 (RDF)
- RSS 2.0 (with or without HTML descriptions)
- Atom 1.0 (with or without HTML descriptions)
- HTML/hCalendar
- iCalendar
- JSON
- PHP serialize()
- Text (CSV)

as output formats. It is reasonably easy to add support for other formats.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Feb 13 '07 #3

P: n/a
Hello,

on 02/12/2007 03:21 PM la***********@zipmail.com said the following:
I'm using PHP 4.4.4 with Apache 2.2. I'm looking for recommendations
on free code I can use to generate RSS feeds. I found FeedCreator
though Google, but that is terrible. It cannot output dates correctly
and it displays a bunch of warnings/notices, even though I never
touched their code.
You may want to take a look at this popular RSS feed generation class.
It supports generating feeds in either RSS 0.9, 0.91, 1.0 and 2.0:

http://www.phpclasses.org/rsswriter

You need to use it in conjunction with this other class:

http://www.phpclasses.org/xmlwriter

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Feb 14 '07 #4

P: n/a
On Feb 13, 9:59 pm, Manuel Lemos <mle...@acm.orgwrote:
Hello,

on 02/12/2007 03:21 PM laredotorn...@zipmail.com said the following:
I'm using PHP 4.4.4 with Apache 2.2. I'm looking for recommendations
on free code I can use to generate RSS feeds. I found FeedCreator
though Google, but that is terrible. It cannot output dates correctly
and it displays a bunch of warnings/notices, even though I never
touched their code.

You may want to take a look at this popular RSS feed generation class.
It supports generating feeds in either RSS 0.9, 0.91, 1.0 and 2.0:

http://www.phpclasses.org/rsswriter

You need to use it in conjunction with this other class:

http://www.phpclasses.org/xmlwriter

I've used Manuel Lemos's classes, and I like them a great deal. they
are clean and easy to use.

-- Lawrence Krubner
http://www.accumulist.com/

Apr 3 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.