How does Topix.net add comments in their feeds?

Discussion in 'PHP' started by Chopster, Dec 29, 2005.

  1. #1
    I was checking out Topix.net last night and saw that each news article has the option to leave comments under them. Since all these news articles are fetched from RSS Feeds around the net, how are they able to work in a comment script into each retrieved news article.

    Hope my question makes sense.
     
    Chopster, Dec 29, 2005 IP
  2. pwaring

    pwaring Well-Known Member

    Messages:
    846
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Presumably they fetch the article from the RSS feed and store it in a database, then it's just as if they posted the article on their site.
     
    pwaring, Dec 29, 2005 IP
  3. Chopster

    Chopster Peon

    Messages:
    628
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Interesting. I never thought of that. I'll have to do some research on how to do this.

    I'm assuming that the database table would have the same fields as those variables in the XML file, correct?
     
    Chopster, Dec 29, 2005 IP
  4. pwaring

    pwaring Well-Known Member

    Messages:
    846
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    135
    #4
    Well, only the fields that are of interest, you might not want to store all of the information. It's not that difficult to do, if you look at Politics Watch you can see where I've syndicated a few political sites - all that happens is a Perl script runs once every two hours, downloads the XML files to disk and then parses them and puts the relevant data into a MySQL table. I can send you the source if you're really interested.
     
    pwaring, Dec 30, 2005 IP
  5. Chopster

    Chopster Peon

    Messages:
    628
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I'd be interested in a PHP version, because I don't know Perl at all. :confused:
     
    Chopster, Dec 30, 2005 IP
  6. pwaring

    pwaring Well-Known Member

    Messages:
    846
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    135
    #6
    For PHP stuff you probably want to take a look at Magpie RSS. which is a feed parser for PHP. Once you've figured out how to use it, you just need to learn how to insert and select information from databases and the rest of the code is fairly simple.
     
    pwaring, Dec 30, 2005 IP
  7. Chopster

    Chopster Peon

    Messages:
    628
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Great, thanks for the heads up pwaring!
     
    Chopster, Dec 30, 2005 IP