#!/usr/bin/env node // Script which scrapes http://google.com/phone and generates JSON files used by this application // To run this file you will need node.js and dependencies listed below var httpAgent = require('http-agent'), jsdom = require('jsdom'), fs = require('fs'), sys = require('sys'); var agent = httpAgent.create('www.google.com', ['/phone/']); var baseDir = __dirname + '/../app/phones/'; var phones = []; function boolean (text) { return /true/i.test(text); } agent.addListener('next', function (error, agent) { var htmlPage = agent.body.replace('', '
'). replace(/