Monthly Archives: June 2010

Chickenfoot mixed with jQuery.

Chickenfoot is a Firefox extension design for website automation.

Chickenfoot is a Firefox extension that puts a programming environment in the browser’s sidebar so you can write scripts to manipulate web pages and automate web browsing. In Chickenfoot, scripts are written in a superset of Javascript that includes special functions specific to web tasks.

Basically, it let’s you take control of Firefox and simulate a user. The API is fill with basic operation, like go(url), append(content), onClick( function, window) and etc. You can get more power and functionality by including other JavaScript libraries and frameworks. That’s when the fun begins.

Since the goal in website automation is a lot of HTML manipulations then, jQuery is the best framework for the job. jQuery can be easily included with a simple fix here.
Here are some examples of Chickenfoot scripts. Once Chickenfoot is installed hit f8, press the “New” tab, then insert one of the following scripts.

Downloading a URL

include( "fileio.js" ); //Enables the write and read commands.
var url = "http://google.com",
content = read( url ),
filename = desktopDir().path + "\\google.html";

write( filename, content );

Clean up craigslist.org

include( "http://bateru.com/js/jquery-1.4.2-mod.js" );
$ = window.$;
var url = "http://houston.craigslist.org/sss/";
go( url, true ); //Refresh the page to the url
sleep(2); // So you can see the different.
var cleanHTML = $(document.body).html().toLowerCase();
cleanHTML = cleanHTML.replace( /[$\*!]{2}|[~\*]/gi, "");
$( document.body ).html( cleanHTML );

Overall, Chickenfoot is a great extension to have. These few examples shown here only scratch the surface of what it’s capable of.

Chickenfoot 1.0.7 link
jQuery link

Larry Battle

I love to program, and discover new tech. Check out my stackoverflow and github accounts.

More Posts - Website

Follow Me:
Twitter