2006-11-04 15:08:00
Way back when I'd just converted this site from static to dynamic (PHP+MySQL) MK was hassling me about adding an RSS feed as well. At the time I didn't have enough spare time to start learning about syndication, but I did this afternoon :) And MK was right: it only took me about an hour to hack together the code for the feed.
So... Your browser should have alerted you of the RSS feed (e.g. Safari shows an RSS icon in the address bar) and as far as I know basic functionality is up and running. Now I need to find a nice way to fix the layout of the feed contents. For some reason line-breaks are ignored and I haven't thought of a nice way to include graphics.
It's not that I seriously expect anyone to subscribe to my feed. Let's just call it an exercise in IT and web design.
EDIT:
I'm also finally coming through on my promise of moving other parts of the site into MySQL. The Sysadmin blog posts are in the DB now as well, which means that they will get included in both the RSS feed and the Archives. Naturally this required me to make a number of changes to the code, which's been educational as well.
kilala.nl tags: website,
View or add comments (curr. 15)
Posted by Cailin Coilleach
Right... Images and line-breaks work now, as do italics and such. I just need to make another minor adjustment to the code that allows for linkage.
I'm also very happy to see that Clint has added me to the list of the Ars Lounge Feedjack. That means all my blog posts show up on one big website with posts of dozens of other Ars Technica forum members. Sweetness!
You can find the ALF over here -> http://arslounge.com
Posted by MK (website)
Yaay RSS feeds! Kilala is becoming Web 2.0 more and more every day! :D
Too bad my pc is kinda dead at the moment, else I would be able to help you with stuff. But you did a great job yourself! :')
Posted by Cailin Coilleach
Awww... I can see by the tears in your eyes that you're proud of me :3 *huggle*
Actually, the only reason I started this whole RSS deal is so that I could be added to the blog-planet at the ALF (see second comment). But yeah, I'm happy. It's always nice to learn about new stuff.
And as you'd said: it's actually really easy to make a feed.
Posted by Tom (website)
/me surfs to /. and makes them aware of kilala's RSS feed ... that should be news for the world :)
Serious, its easy to make a feed, but it nice to learn it and i think Cailin did it in quite a small timeframe.
Cheers!
(although you could have created a mindmap first *g*)
Posted by Cailin Coilleach
ONOZ! Please not to be Salsdotting me!
/me cowers in fear.
Also: yea, all in all it took me about 1.5 hours to go from scratch to the feed that I have now (which includes images and fully working HTML, converted from my blog posts in MySQL).
Posted by Faragon (website)
Haha, you geek! ;-)
You are *so* on my RSS feed list now though :-)
Posted by Cailin Coilleach
I just remembered another thing MK bothered me about: cookies. That would make the commenting feature on the site so much easier to use.
I'll start looking into those tonight...
Posted by Cailin Coilleach
Well, that was easy. I learned all I needed to know about cookies from the following two sites.
http://www.w3schools.com/php/php_cookies.asp
http://p2p.wrox.com/topic.asp?TOPIC_ID=17478
Posted by Cailin Coilleach
What's a live bookmark? :)
I'll contact you through e-mail to figure this out :)
Posted by Cailin Coilleach
I'm working on fixing this. Firefox is probably borking out due to a few invalid items in my feed.
1) The MIME type was incorrectly set to html/xhtml by the webserver. Adding the following to the PHP script has fixed this:
header('Content-type: application/rss+xml');
This needs to be the first line of your RSS page/feed/script.
2) The date/time was not formatted according to RFC-822. This is easily fixed using PHP's date() function.
$pubDate=date("r",$row[date]);
echo "
3) Some of the URLs I link to contain ampersands, like URLs for YouTube or the Ars Technica fora. Unfortunately these cannot be simply removed :( I'm looking into fixing this.
Posted by Cailin Coilleach
Ha! Squashed the last two bugs.
3) The problems with weird characters in links solved by embedding the whole text in the
echo "
PHP code to generate content...
echo "]]>";
4) My titles occasionally contain HTML tages. These are removed through the following:
$title=strip_tags($row[title]);
echo "
Posted by Cailin Coilleach
Whoops! Made one mistake that catapulted my blogposts back to december of 1969 :D The _correct_ code would be:
$pubDate=date("r",strtotime($row[date]));
Posted by Cailin Coilleach
About four months down the road I've got ten individual subscribers to my RSS feed, six of whom appear to be human. I downloaded the access logs from TransIP's web server, which covers a day of page hits so there may be more subscribers!
Here's what I got so far:
kilala $ grep "/rss.php" access_log | awk '{print $1" "$12}' | sort -u | sort -n
62.133.208.42 "Mozilla/5.0
64.111.120.8 "Feedjack
65.222.176.122 "Mozilla/4.0
72.14.199.68 "Feedfetcher-Google;
80.196.98.10 "Mozilla/3.01
82.93.225.96 "Mozilla/5.0
151.198.208.253 "Mozilla/4.0
208.66.64.171 "Technoratibot/0.7"
208.66.64.4 "Technorati
213.148.224.126 "Mozilla/5.0
So that's two for Technorati, one for the Ars Lounge FeedJack and one for Google. The rest are humans :) Joy!
All content, with exception of "borrowed" blogpost images, or unless otherwise indicated, is copyright of Thomas Sluyter. The character Kilala the cat-demon is copyright of Rumiko Takahashi and used here without permission.
2006-11-04 18:01:00
Posted by Cailin Coilleach
If anyone's curious which Howto's I've used to quickly hack the things together, here's the most useful links. Sorry that they're not clickable :)
http://www.petefreitag.com/item/465.cfm
http://searchenginewatch.com/showPage.html?page=2175271
http://www.samspublishing.com/articles/article.asp?p=388271&seqNum=1&rl=1
http://blogs.law.harvard.edu/tech/rss