Parameters to RSS Feed ?
Moderator: General Moderators
Parameters to RSS Feed ?
Lets say I have in my site word of the day like :
http://dictionary.reference.com/wordoftheday/wotd.rss
Is it possible for me to have another rss feed (meaning.rss) where I give a paramater (meaning.rss?word=hello) which will return the meaning of the word in xml (rss) ?
Thanks
http://dictionary.reference.com/wordoftheday/wotd.rss
Is it possible for me to have another rss feed (meaning.rss) where I give a paramater (meaning.rss?word=hello) which will return the meaning of the word in xml (rss) ?
Thanks
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
You didn't mention that before.anjanesh wrote:because my question relates to generation of RSS Feeds using PHP.
Well, lets see. you want to have a meaning.rss to which you can pass a parameter. You see the fact is RSS is a fixed xml format so it can't just dynamically sort out a meaning.
Maybe you would like to change the target from meaning.rss to meaning.php
meaning.php (or meaning.php.rss as this seems to be pasing php) - and output in pure XML format.
But will this validate in a RSS validator and the most important - can other people include these php files ?
If RSS is a fixed xml format then how to sites update things like Latest News, Quote of the Day etc - Im pretty sure they don't manually update - any PHP code within rss ?
But will this validate in a RSS validator and the most important - can other people include these php files ?
If RSS is a fixed xml format then how to sites update things like Latest News, Quote of the Day etc - Im pretty sure they don't manually update - any PHP code within rss ?
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
I think your overlooking one thing. The RSS readers, which checks one address again and again and again. Is the user going to have to update the address every day for the new word meaning? Sort of negates the benefits of using RSS.
You can use PHP to create a "word of the day" RSS feed. It could give the last seven days words in word.rss (or word.php as long as you return the right content-type for RSS readers) with each of the words linked to meaning.php?word=X. This has the added bonus that they return to your site for the meaning thereby developing return traffic.
You can use PHP to create a "word of the day" RSS feed. It could give the last seven days words in word.rss (or word.php as long as you return the right content-type for RSS readers) with each of the words linked to meaning.php?word=X. This has the added bonus that they return to your site for the meaning thereby developing return traffic.
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
The only time I've had trouble with PHP feeds are when they return the wrong content-type. Some readers are more strict than others. As for which one is the right content-type ... well that's a good question? I've been using: application/rss+xml with RSS 0.92.anjanesh wrote:Thanks Budda. So content-type for RSS readers works if the extension is a .php containing php code. That was what I wanted to know.Buddha443556 wrote:or word.php as long as you return the right content-type for RSS readers
There's a drew back to using file extension PHP as browsers like Firefox can't find them for the live bookmark indicator. Cron'ing the RSS feed is better for this reason but you could process your RSS files as PHP or do a server side redirect to the php file.
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
It's not how often your news updates that should determine your method of production but the traffic on the feed. Feeds can generate a lot of traffic because they are checked automatically by RSS readers some of which are crap. So if your feed is low traffic fry (php.rss) or bake (cron) it when traffic becomes a problem bake it or throw more hardware at it.anjanesh wrote:Regarding Cronning : what if theres a news feed that keeps updating minute by minute - In that case definitely news.php.rss would be better than to cron a news.rss file - every one minute a cron takes place - doesnt look good.
I gave these two in the first 2 lines :
FF keeps showing the download box - its not showing the xml file.
Code: Select all
header("Content-type: application/rss+xml");
echo '<?xml version="1.0" encoding="UTF-8"?>';- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US