Created
April 3, 2015 04:11
-
-
Save jmandel/4dcf8ae97962dd085f0a to your computer and use it in GitHub Desktop.
Extract Housing Details from Craigslist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| listings = []; | |
| $.each($("span.txt"), function(i, l){ | |
| var url = $("a", l).attr("href"); | |
| var title = $("a", l).text(); | |
| var posted = $("time", l).attr("datetime"); | |
| var price = $("span.price", l).text(); | |
| var neighborhood = $("span.pnr small", l).text(); | |
| var br = $("span.housing", l).text(); | |
| var fees = $("a.gc", l).text(); | |
| listings.push([title, url, posted, price, neighborhood, fees].join("\t")); | |
| }); | |
| console.log(listings.join("\n")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Write this code and I offer 5% commission for every apartment rented next year.I need a java script written to automate a process. I am a real estate agent and I need to create multiple ads with the same set of predetermined data. I should be able to easily go into the script and edit the information I want on each field in all of the ads I am creating. For example, If I want to create 20 ads for a new ad I should be able to go in, edit the details in the script to match what I want in the fields, and then when I run the script it should create 20 new ads with the same data in each.
If you want more info email me matthewtej@gmail.com