Menu Close

PowerShell + Craigslist for advanced apartment hunting

I was very, very tired of copying/pasting a template saying “Hi I’m Rex and I’m thinking about moving to NYC because of a job offer.. no pets, no kids, no wife, etc” to each place I found appealing. I decided to scrape craigslist and build PowerShell objects that I could sort and use to automagically spam my potential new roommates! 🙂

Here’s the script that’ll do the scraping and build an array of objects:

And here’s what a sample object looks like, though you could probably guess by the object declaration:
Sample object

Playing with data is fun, right?
Sample list of objects

There’s a ton that COULD be done with this, I’m only scratching the surface! 🙂

———————————- UPDATE ———————————-

I’ve semi-wrapped it in a function for ease of use:

Using Find-Apartment

 22,293 total views,  3 views today


  1. Josh Reichardt

    Hi Rex,

    I really like your idea here and I’m trying to modify it for my own use. I’m having trouble understanding a few of the variables you are creating and getting them to work for me, the $Link,$Email,$Description. Can you explain what you are doing with these?

    Great job on the post!

Leave a Reply

Your email address will not be published. Required fields are marked *