Skip to content

Instantly share code, notes, and snippets.

View niallsmart's full-sized avatar

Niall Smart niallsmart

View GitHub Profile
@niallsmart
niallsmart / Craigslist extract
Created February 13, 2011 19:24
Simple JQuery snippet to extract Craigslist search results to CSV
$("p.row").each(function(index) {
var csv = $(this).text().trim().replace(/[ \r\n\t]+/g, ' ');
csv = csv.replace(/ pic$/, "\tpic")
csv = csv.replace(/ pic img$/, "\tpic img")
csv = csv.replace(/^([^-]*)- /, "$1\t")
csv = csv.replace(/ - ([($])/, "\t$1")
//csv = csv.replace(/(\$[0-9]+) ([^(])/, "$1\t\t$2")