One of this year’s most interesting open source projects has been PhantomJS – a headless WebKit with JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. I’ve already used it to automatically scrape data from pages and for testing. In this post we will use PhantomJS along with confess.js to analyze web page performance. confess.js currently has two main functions: to provide simple page performance profiles, and to generate a app cache manifests.
Read More

Repo.js is a jQuery plugin that enables you to embed GitHub repositories into any webpage. It works by reading the repository information from GitHub and dynamically building a DOM tree of the directories. The complete hierarchical structure is downloaded in a single go and saved as a DOM structure, making it extremely fast. However file source for each one is retrieved only when clicked. A simple example for the twitter bootstrap repo is shown below.
Read More

Querying MySQL with Node.js

by: Sameer Posted in: nodejs |   ( 9 ) Comments

30 Jun 2012

Node.js is slowly making inroads in normal web development routines. There are a number of modules available for Node to work with almost any requirement you imagine, although the stability of many of them is open to question. Although I’ll surely not switch my development practices to Node from PHP any time soon; for many tasks Node would be a perfect match. For example for one site I use a CRON job to regularly sync remote data to MySQL. Node with its support for asynchronous requests may possibly help me make the data syncing faster.
Read More

In one of my previous posts we saw how we could take webshots of web pages using ‘wkhtmltoimage‘ toolkit. Now we have something more flexible with PhantomJS. PhantomJS is what we call a headless WebKit with JavaScript. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. You can programmatically access web page content for scraping, monitoring or testing purposes, including webpage features that work with JavaScript, which is not possible using server side languages. For most reasons you can think of it as a browser without a window, where we drive it via JavaScript. Here we are using it to grab the webshots of web pages.
Read More

Automatically extracting attachments from Gmail can be important for reasons where you need to process the attached files periodically with a CRON job. Also it can be useful for automatically archiving important attachments. Below is a simple proof-of-concept plain PHP code, devoid of any object-oriented features that extracts attachments from your Gmail account. It uses PHPs imap extension to access the inbox.
Read More

Sign up for fresh content in your email