Skip to content

Instantly share code, notes, and snippets.

@jmandel
Created April 3, 2015 04:11
Show Gist options
  • Select an option

  • Save jmandel/4dcf8ae97962dd085f0a to your computer and use it in GitHub Desktop.

Select an option

Save jmandel/4dcf8ae97962dd085f0a to your computer and use it in GitHub Desktop.
Extract Housing Details from Craigslist
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"));
@newyorkguy
Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment