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

Tool to build RSS feed?

P: n/a
Hello

I'm not an expert on RSS, and I'd like to find a tool to make
it easy to create an RSS feed for a site whenever a new row is created
in a MySQL database.

Is there some PHP tool that would make this easy to do?

Thank you.
May 29 '07 #1
Share this Question
Share on Google+
10 Replies


P: n/a
On May 29, 2:55 pm, Gilles Ganault <nos...@nospam.comwrote:
Hello

I'm not an expert on RSS, and I'd like to find a tool to make
it easy to create an RSS feed for a site whenever a new row is created
in a MySQL database.

Is there some PHP tool that would make this easy to do?

Thank you.
Google it :o)

Making an RSS feed is easy - there are plenty of templates out there.
All you need to do to create a dynamic RSS feed is to write a PHP file
and make it call to the database to get the required data and output
XML headers and then follow the template.

Or if you think that's lame - you can generate a new XML file
everytime something new is added to the database.

May 29 '07 #2

P: n/a
On 29 May 2007 15:16:23 -0700, SterLo <st***************@gmail.com>
wrote:
>Google it :o)
I obviously did, and stumbled on two.. that didn't work :-/ One of
them is feed.class, which I downloaded from

http://svn.sourceforge.net/viewvc/de...ss?view=markup

//Fatal error: Call to undefined function get_branding()
$r.= sprintf("\t\t<generator>%s</generator>\n",
htmlentities(get_branding(FALSE)));
>Making an RSS feed is easy - there are plenty of templates out there.
All you need to do to create a dynamic RSS feed is to write a PHP file
and make it call to the database to get the required data and output
XML headers and then follow the template.
Is there a template you would recommend?

BTW, do I create a new file with new items instead of appending them
to older items?

Thank you.
May 29 '07 #3

P: n/a
Gilles Ganault wrote:
http://svn.sourceforge.net/viewvc/de...ss?view=markup

//Fatal error: Call to undefined function get_branding()
$r.= sprintf("\t\t<generator>%s</generator>\n",
htmlentities(get_branding(FALSE)));
That's my feed class -- eek! I didn't know that Feed.class called the
"get_branding" function -- I thought it was reasonably independent of
the rest of demiblog. I'll make changes ASAP to remove this dependency.

In the mean time, I recommend creating a function get_branding like this:

function get_branding () { return "Your Site Name"; }

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 95 days, 15:44.]

Non-Intuitive Surnames
http://tobyinkster.co.uk/blog/2007/0...tive-surnames/
May 30 '07 #4

P: n/a
Gilles Ganault wrote:
//Fatal error: Call to undefined function get_branding()
Fixed now -- just download a new copy.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 95 days, 15:53.]

Non-Intuitive Surnames
http://tobyinkster.co.uk/blog/2007/0...tive-surnames/
May 30 '07 #5

P: n/a
..oO(Toby A Inkster)
>Gilles Ganault wrote:
>http://svn.sourceforge.net/viewvc/de...ss?view=markup

//Fatal error: Call to undefined function get_branding()
$r.= sprintf("\t\t<generator>%s</generator>\n",
htmlentities(get_branding(FALSE)));

That's my feed class -- eek! I didn't know that Feed.class called the
"get_branding" function -- I thought it was reasonably independent of
the rest of demiblog. I'll make changes ASAP to remove this dependency.
Is that called remote debugging? ;)

Micha
May 30 '07 #6

P: n/a
Michael Fesser wrote:
Is that called remote debugging? ;)
I suppose so, though I doubt Usenet would be a suitable communication
channel if the remote debugging were to be mechanised.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 95 days, 18:30.]

Non-Intuitive Surnames
http://tobyinkster.co.uk/blog/2007/0...tive-surnames/
May 30 '07 #7

P: n/a
On Tue, 29 May 2007 23:55:53 +0200, Gilles Ganault <no****@nospam.com>
wrote:
>Is there some PHP tool that would make this easy to do?
Apparently, it's not that complex, and I just need to create a text
file that looks like this:

=================
<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<channel>
<title>My Dummy Channel</title>
<link>http://localhost/dummy.xml</link>
<description>Some dummy channel</description>
<!--pubDate>Wed, 30 May 2007 15:30:15 CEST</pubDate-->
<item>
<title>Some dummy title</title>
<link>http://localhost/1.html</link>
<pubDate>Wed, 30 May 2007 18:15:19 CEST</pubDate>
<guid>http://www.sortirsurparis.net/sortie_read.php?13521</guid>
<description>Some <a
href="http://localhost/1.html">link</a>.</description>
</item>
</channel>
</rss>
=================

=Although it's not PHP-related... I have a couple of questions:

1. Do I have to update the Channel's <pubDatevery time I add an item
in the file for RSS clients to notice that it was updated, or do RSS
clients parse the whole file and read each item's pubDate to tell if
they know about it?

2. Do RSS clients keep track of items they know about, so that I don't
need to keep more than today's items in the file (just for readers who
only check this RSS feed when they come home)?

Thank you.
May 30 '07 #8

P: n/a
On Wed, 30 May 2007 20:51:59 +0200, Gilles Ganault <no****@nospam.com>
wrote:
>Apparently, it's not that complex, and I just need to create a text
file that looks like this:
For those interested, it can be even simpler:

<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0">
<channel>

<title>My Dummy Channel</title>
<link>http://www.acme.com/rss.xml</link>
<description>Some dummy channel</description>

<item>
<title>Test</title>
<link>http://www.acme.com/article.php?123</link>
<description>A basic description</description>
<guid isPermaLink="false">123</guid>
</item>

</channel>
</rss>

Items can even have the same title: Just incrementing GUID is enough
for RSS clients to tell new items from old ones.

HTH,
May 30 '07 #9

P: n/a
I told you it wasn't hard :op

May 31 '07 #10

P: n/a
On 31 May 2007 07:33:18 -0700, SterLo <st***************@gmail.com>
wrote:
>I told you it wasn't hard :op
Yup :-)
Jun 1 '07 #11

This discussion thread is closed

Replies have been disabled for this discussion.