SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Member
    Join Date
    Apr 2005
    0 Post(s)
    0 Thread(s)

    New PHP Rss Reader that caches to Mysql

    edit: Big error found. Ill post up the link when it's fixed.

    I just finished writing a php Rss Reader that caches the contents of a RSS feed to a mysql database. I did steal the xml parser code from "PHP RSS Reader v1.1 by Richard James Kendall" but I wrote the rest. This is a first draft, and the code is still messy but if you really want the script I can email it to you. It is somewhat faster than MagpieRss but much, much less advanced. I added the form at the beginning so you can test it, but it's made to get either a link or an RSS_id that is stored in the database.

    The link:

    Note: The server is hosted on a DSL connection right now, so if it's slow, that's why.

    Here's whats happening:
    1. php gets the link or id

    2. php reads from the db the rss channel title, link, item titles, item descriptions, item links, and the timeout (expiration) time.

    3. php checks if time() now is greater than or less than the number stored in timeout.

    4. if the feed stored in the db is still "fresh" (meaning it has been in there for 20 minutes or less), php will explode() the item titles, item links, and item descriptions, and will create a loop to show them.

    5. if it's stale, php will parse the feed, store the items into the db, then display the contents.

    If you want, i can put up a Magpie example so you can compare times.

    Let me know what you think.
    Last edited by raouldukelv; May 1, 2005 at 03:20.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts