Skip to Content
eBay Hacks, 2nd Edition
book

eBay Hacks, 2nd Edition

by David A. Karp
June 2005
Beginner
463 pages
14h 19m
English
O'Reilly Media, Inc.
Content preview from eBay Hacks, 2nd Edition

Receive Search Results via RSS

Use PHP to distill eBay search results into a format that can be read by an RSS news aggregator.

RSS is a popular way to track changes to news sites and blogs. When a site adds new content, it updates its RSS feed with information on the new item, including the title, URL, and description.

Using a news aggregator program, you can subscribe to RSS feeds for your favorite sites. These programs watch for changes in RSS feeds. When they find something new, they retrieve the listing and display it to you. This allows you to easily keep up-to-date on hundreds of web sites without needing to continually go back to each site looking for new material.

While RSS is most commonly used to track articles and blog posts, you can also use it to track eBay listings. This hack creates a PHP 5 script that searches eBay and converts the results to RSS using XSLT. This hack reuses many of the components from “Create Custom-Formatted eBay Search Results with the REST API” [Hack #107] , so you may want to read that one before continuing with this one.

RSS readers, however, can’t understand eBay’s XML results, so you need to convert the output into RSS. Conveniently, RSS is also an XML-based format, so it’s easy to use XSLT to turn eBay XML into RSS XML.

Here’s an XSL stylesheet that does that:

 <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="http://exslt.org/dates-and-times" xmlns:ebay="http://ebay.com/api/functions" xmlns:func="http://exslt.org/functions" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

eBay Hacks

eBay Hacks

David A. Karp
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz

Publisher Resources

ISBN: 059610068XErrata Page