tags:

views:

32

answers:

1

Before working on an RSS feed in PHP, I just had a few questions that aren't covered in the basic online guides

  1. When you first subscribe to a feed, is there anything telling the script that this is the first sync? IE a tag, a url parameter, or something that conveys to the system that you just subscribed.
  2. Likewise, when you unsubscribe to a feed is there anything telling the script that you just unsubscribed?
  3. How often is a feed usually queried for changes? Every 5 minutes? 10 minutes? 30?
  4. How do you send all of the content? I'm pretty sure its not just one giant file containing everything since the feed was started, but (at least in Google Reader) you see the last 10 or so entries, not everything.

Thanks

+2  A: 
  1. No — although you could try to set a cookie. If one isn't in the request then either it is a new subscriber or someone who uses a system that doesn't support cookies (which I suspect would be quite common).
  2. No — although if the client supported cookies you could look to see when a unique id stopped requesting the feed.
  3. Hourly is fairly typical.
  4. Generally speaking, you don't. The typical use case for RSS is to inform people when there is new content, not to distribute the entire archive. You could use the format to distribute an archive, but that would typically be used for a one shot initialization of a system which would then subscribe to the subscription feed to get updates.
David Dorward
Wait, a feed is rolling window? I didn't think it was a "remove last entry, add newest entry" type thing. That makes the idea of subscribing a lot easier.
TheLQ
Yes, typically containing "most recent n entries" or "all entries created / update in the last n days". Generally the data comes from a database, so the feed gets refreshed from there rather then having things added and removed from it.
David Dorward
Alod, don't forget to implement PubSubHubbub for your feed. People will poll it less often and still get your content in realtime!
Julien Genestoux
@Julien Because the world really needs another RSS format...
TheLQ
Eh? PubSubHubbub doesn't replace RSS (although Atom does, and its a much better specific data format)
David Dorward
TheLQ : sorry, but PubSubHubbub is NOT a new RSS format. Next time, try to read a bit before criticizing :)
Julien Genestoux