| KickRSS | Blog Contact Us Help Manage Feed |
|
|
Using RSS for Classified AdsWhen it comes to using RSS, most people are familiar with the distribution of news feeds, or content that is typically provided in a text format, delivering the latest information related to news stories on what ever subject the RSS feed is related to. When I come across other uses of RSS syndication I like to share the information in hopes others will begin utilizing similar techniques. I recently worked on a project involving a web site that has a classified ad portal running on CGI Perl scripts. The scripts were built in the 1990s, and while they have had some modifications since that time, there was no implementation of RSS being used on the website. I took a look at some of the data files being used for this classified ad site and they were your typical pipe delimited “|” flat file database text files. First thing I had to do was go through the information that was in a typical entry for a classified ad posting and determine which parts would be important to be included into the RSS feed. Taking a look at the database file there was a numerical entry that identifies the ad post, definitely wanted to include that. There was a lot of stuff that looked like it could be important but after thinking it over and relating the ad to the context of an RSS feed, most of it could be removed. I was not interested in things like the category the ad was placed in, the city or state of the user, the web site of the user, phone number of the user, and whether they wanted to subscribe to the classified ad newsletter. The city and state of the user to come in handy in the future but I just wanted to get this thing to work. What I did include was the numerical code that represented the ad, that became the <link>. I was also interested in the headline of the ad, which became the <title>. Following that was interested in the content or subject body of the advertisement which is in the <description> tag of the RSS feed. For <author> I used a standard entry that represented the web site the ads were posted to. The <pubDate> is auto generated and displays the date and time the ad is inserted into the RSS feed. So essentially, that’s all I needed to have information from the classified ads show up in RSS. Here is an example… <item>beginning of the item As a result this web site can now distribute their classified advertising RSS feeds via syndication, a huge plus for users of the web site as they could potentially bring in many more eyeballs to view advertisements placed by users. In making this happen I used a tool called feedcreator (see my last post) and created a PHP file that gets updated via Cron at regular intervals. PHP file writes to the XML file, which becomes the RSS feed. If your browser supports the XML extension you can view the output of the classified ads using this link… http://www.planetc1.com/rss/cs.xml For those of you looking to convert flat file databases into active RSS feeds I’d recommend getting the feedcreator library which will make your work a lot easier. I’ll get into the PHP file that was created to convert the flat file information we wanted into the XML feed in another post. I’m already late for work. Leave a Reply |
|