Gary's Guide To Nodejs

Please find below some of the most popular articles I've written on Gary's Guide To Nodejs.

Table of Contents

Diagnosing Connection Leaks in Node.js and Postgres

Fix to error installing “forever” for nodejs

Scraping Adsense Ads with PhantomJS



Diagnosing Connection Leaks in Node.js and Postgres

In building a website scraper with Chrome and Node.js, I made mistakes that led to connection leaks. In this application, the scraper runs in a browser and connects to a node.js server, which saves data off to a database. Once you know what the issues look like, they are easy to see, but otherwise often difficult [...] Read More...

Fix to error installing “forever” for nodejs

After doing “npm install forever” in a VirtualBox instance you may get an error like the following. This is caused by running the install from a folder shared with the host machine. Certain file operations fail when crossing the machine/file system boundary in VirtualBox. npm ERR! error rolling back [email protected] Error: UNKNOWN, unlink '/vagrant/node_modules/forever/node_modules/winston/docs/winston/transports.html' npm [...] Read More...

Scraping Adsense Ads with PhantomJS

PhantomJS is a headless WebKit, which lets you run Javascript in a browser from the command line. It adds additional API calls which facilitate automated testing, screenshots, and scraping. I thought it would be interesting to write a script to retrieve Adsense destination URLs and text with PhantomJS. Extracting advertisement blocks requires fairly simple CSS [...] Read More...