Click here to Skip to main content
15,113,295 members
Articles / Desktop Programming / Windows Forms
Posted 12 Dec 2008


41 bookmarked

Watching Craigslist

Rate me:
Please Sign up or sign in to vote.
4.82/5 (10 votes)
3 Jan 2009BSD2 min read
Show automatically updated search results from Craigslist on your desktop


Craigslist is a hugely popular website with free local listings for jobs, housing, and items for sale.

Trying to buy something on Craigslist is like a flock of seagulls going after one French fry. If something good gets posted, it might be gone before you get a chance to call. So do you scan new items every morning? What if you miss a day? There are hundreds of new items that get posted each day. 

I wanted a desktop window that would show me filtered search results from Craigslist and update them periodically.


Instead of sending Craigslist a server-side query, I decided to just get the Craigslist RSS feed and filter the results on the client-side. There are two advantages of this -- server changes don't break our code and we can watch other feeds in a similar way (for example, eBay).  At first, I made a general purpose feed monitor, but it got kind of abstract and complicated and I decided a Craigslist specific application would be nicer and easier to explain.


A listview is used to display results so I can sort by column (e.g. price or date).


For most searches, just type some keywords and press enter to load the results. Double-clicking on an item in the results list will open it in a browser. Or you can just click on the "open item" button. The Category button will open the entire list in a browser. For more advanced searches, press the Advanced button.


For email alerts, check the send email alerts box and setup an email address.



Settings are saved and restored using XML serialize.

StreamWriter sw = new StreamWriter(path);
new XmlSerializer(obj.GetType()).Serialize(sw, obj);

You gotta love C#. And when we load and parse the RSS feed, XML does the trick again.

XmlDocument feed = new XmlDocument();
XmlNodeList nodes = feed.GetElementsByTagName("item");

foreach (XmlNode node in nodes)
    // get node info
    if (Match(info)
    // add to results

Similar Tools

There are other similar programs out there but none of them provide free C# code so you can extend them.

Extending This

You could easily add multiple searches and a treeview control to expand titles into descriptions.  For this article, I decided to keep those features out.  The advanced search form could easily be expanded to allow excluded keywords and any-or-all keywords.


  • Dec 12, 2008: Original submission
  • Dec 13, 2008: Added email alerts
  • Dec 13, 2008: Updated source and demo project 
  • Dec 29, 2008: Updated source and demo projects 


This article, along with any associated source code and files, is licensed under The BSD License


About the Author

Software Developer Buzz Monkey Software
United States United States
David McClurg is a game programmer from Oregon, USA. He is currently interested in C#, xna for zune, and steering behaviors. When not coding, David enjoys tennis, kayaking, and botany.

Comments and Discussions

Bugheur:Trojan-PSW.MSIL.Oligo.gen Pin
cehrhart28-Apr-17 13:56
Membercehrhart28-Apr-17 13:56 
QuestionQuestion Pin
ali_331014-Dec-12 4:57
Memberali_331014-Dec-12 4:57 
GeneralMy vote of 3 Pin
inkcolorYui24-Mar-12 18:24
MemberinkcolorYui24-Mar-12 18:24 
QuestionNot working right!!! Pin
Member 78875002-May-11 8:03
MemberMember 78875002-May-11 8:03 
AnswerRe: Not working right!!! Pin
milkplus2-May-11 10:11
Membermilkplus2-May-11 10:11 
GeneralRe: Not working right!!! Pin
Member 78875002-May-11 10:16
MemberMember 78875002-May-11 10:16 
GeneralRe: Not working right!!! Pin
coreyt5-Feb-13 19:55
Membercoreyt5-Feb-13 19:55 
Question"My Ebay" Button Pin
ardns29-Jun-10 0:37
Memberardns29-Jun-10 0:37 
AnswerRe: "My Ebay" Button Pin
milkplus29-Jun-10 7:00
Membermilkplus29-Jun-10 7:00 
GeneralAdding an email link in the email message Pin
C# Friendly11-Oct-09 13:14
MemberC# Friendly11-Oct-09 13:14 
GeneralRe: Adding an email link in the email message Pin
milkplus11-Oct-09 15:40
Membermilkplus11-Oct-09 15:40 
Generalsearching multiple items Pin
C# Friendly3-Oct-09 16:48
MemberC# Friendly3-Oct-09 16:48 
GeneralRe: searching multiple items Pin
milkplus4-Oct-09 8:36
Membermilkplus4-Oct-09 8:36 
GeneralRe: searching multiple items Pin
C# Friendly11-Oct-09 12:59
MemberC# Friendly11-Oct-09 12:59 
GeneralThe include files are for Watching eBay Pin
JamesMMM29-Dec-08 11:45
MemberJamesMMM29-Dec-08 11:45 
Where are the craig's list project files?
GeneralRe: The include files are for Watching eBay Pin
milkplus3-Jan-09 12:23
Membermilkplus3-Jan-09 12:23 
GeneralRSS feed Pin
Todd Smith13-Dec-08 11:57
MemberTodd Smith13-Dec-08 11:57 
GeneralLocations Pin
oldpartz13-Dec-08 10:13
Memberoldpartz13-Dec-08 10:13 
GeneralRe: Locations Pin
Todd Smith13-Dec-08 11:35
MemberTodd Smith13-Dec-08 11:35 
GeneralRe: Locations Pin
oldpartz13-Dec-08 11:48
Memberoldpartz13-Dec-08 11:48 
GeneralRe: Locations Pin
Todd Smith13-Dec-08 11:45
MemberTodd Smith13-Dec-08 11:45 
GeneralRe: Locations Pin
oldpartz13-Dec-08 12:12
Memberoldpartz13-Dec-08 12:12 
GeneralVery nice article! Pin
thompsons13-Dec-08 8:23
Memberthompsons13-Dec-08 8:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.