RSS

Posted by Zeno on Fri 01 Apr 2011 08:49 AM — 9 posts, 46,097 views.

USA #0
Hey Nick,

Just wanted to notify you I'm scraping the RSS feed here for this: http://twitter.com/#!/MUD_news

If you have any questions/concerns, you know how to contact me. :)

Also I had a question about the RSS. At first glance, I thought it was RSS for latest topics. But it appears to be RSS for the latest posts, restricted to that topic only showing up once in the RSS.

Any chance for a RSS on latest topics? Latest post RSS will end up making my feed have duplicate posts.
USA #1
Also wanted to mention something weird about the feed. If you see these two:
http://twitter.com/#!/MUD_news/status/53461212905734145
http://twitter.com/#!/MUD_news/status/53507275121360897

They link to the same post, but one is on gammon.com.au and the other mushclient.com

That could only happen if the RSS feed had it like that. Any chance you could double check to make sure the feed only uses one domain? :)
Australia Forum Administrator #2
They are the same file, because the RSS feed generator writes to one place. However what I think is happening is that Twitter is finding the same file under two domains. I don't know what I can do about that. The two domains point to the same physical file, and it will have the same data in it.
USA #3
I think that he's talking about the contents of the feed, not the feed's location itself. If he's tweeting posts from a given feed, but the post URLs are mixed between gammon.com.au and mushclient.com, that's a problem with the feed itself.

Zeno: Nobody does it right, so don't feel bad about this, but when you link to a tweet, remove the "#!/". If anyone who has javascript disabled tries to follow that URL, they won't get the right thing. This is because anything after a # in a URL is part of the fragment ID, not the URL.
Amended on Sat 02 Apr 2011 08:05 AM by Twisol
Australia Forum Administrator #4
OK, the domain you came from was written to the file. I think I have fixed it.
Australia Forum Administrator #5
Well, maybe not. How about this?
USA #6
Twisol has it right. The feed is producing URLs of different domains.

The last 3 from the feed had one domain used (gammon.com.au) which looks okay, but the URLs are different (one without www, another without bbshowpost.php)

Oh and Twisol, yeah my bad. reddit complains about that all the time, I just tend to forget to fix the URL.
USA #7
It looks all straightened out, though!
Australia Forum Administrator #8
It should be OK now. I amended it again just then to remove the "bbsubject_id=", but that was hard coded. This is the current code:


   while ($row = mysql_fetch_array ($result))
      {
      fwrite ($fd, "\n<item>\n" );
      fwrite ($fd, " <title>" . 
              htmlspecialchars ($row ['fullname']) . 
              "</title>\n");
      fwrite ($fd, " <link>" . 
                "http://www.gammon.com.au/forum?id="; . 
                $row ['bbsubject_id'] . 
                "&amp;page=999" .
                "</link>\n");
      fwrite ($fd, " <description>" . 
              "Post by " . 
              htmlentities ($row ['username']) .
              "</description>\n");
      fwrite ($fd, " <author>" . 
              htmlentities ($row ['username']) .
              "</author>\n");
      fwrite ($fd, " <pubDate>" . 
              htmlentities ($row ['formatted_date']) .
              "</pubDate>\n");
      fwrite ($fd, "</item>\n" );
           
      } // end of reading each row
      
  fwrite ($fd,     
    "</channel></rss>\n"
    );  
    


In particular the line in bold just has a hard-coded URL (now) and just mentions the subject number. That shouldn't chop and change.