{"id":204,"date":"2010-06-01T15:48:06","date_gmt":"2010-06-01T21:48:06","guid":{"rendered":"http:\/\/bateru.com\/news\/?p=204"},"modified":"2010-06-01T20:37:03","modified_gmt":"2010-06-02T02:37:03","slug":"chickenfoot-mixxed-with-jquery","status":"publish","type":"post","link":"https:\/\/bateru.com\/news\/2010\/06\/chickenfoot-mixxed-with-jquery\/","title":{"rendered":"Chickenfoot mixed with jQuery."},"content":{"rendered":"<p><a href=\"http:\/\/groups.csail.mit.edu\/uid\/chickenfoot\/\">Chickenfoot<\/a> is a Firefox extension design for website automation. <\/p>\n<blockquote><p>\nChickenfoot is a Firefox extension that puts a programming environment in the browser&#8217;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.\n<\/p><\/blockquote>\n<p>Basically, it let&#8217;s you take control of Firefox and simulate a user. The <a href=\"http:\/\/groups.csail.mit.edu\/uid\/chickenfoot\/api.html\">API<\/a> 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&#8217;s when the fun begins.<\/p>\n<p>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 <a href=\"http:\/\/groups.csail.mit.edu\/uid\/chickenfoot\/scripts\/index.php\/Using_jQuery%2C_jQuery_UI_and_similar_libraries\">simple fix here<\/a>.<br \/>\nHere are some examples of Chickenfoot scripts. Once Chickenfoot is installed hit f8, press the &#8220;New&#8221; tab, then insert one of the following scripts. <\/p>\n<blockquote><p>\n<b>Downloading a URL<\/b><br \/>\n<code><br \/>\ninclude( \"fileio.js\" );   \/\/Enables the write and read commands.<br \/>\nvar url = \"http:\/\/google.com\",<br \/>\n    content = read( url ),<br \/>\n   filename = desktopDir().path + \"\\\\google.html\";<\/p>\n<p>write( filename, content );<br \/>\n<\/code>\n<\/p><\/blockquote>\n<blockquote><p>\n<b>Clean up craigslist.org<\/b><br \/>\n<code><br \/>\ninclude( \"http:\/\/bateru.com\/js\/jquery-1.4.2-mod.js\" );<br \/>\n$ = window.$;<br \/>\nvar url = \"http:\/\/houston.craigslist.org\/sss\/\";<br \/>\ngo( url, true ); \/\/Refresh the page to the url<br \/>\nsleep(2); \/\/ So you can see the different.<br \/>\nvar cleanHTML = $(document.body).html().toLowerCase();<br \/>\ncleanHTML = cleanHTML.replace( \/[$\\*!]{2}|[~\\*]\/gi, \"\");<br \/>\n$( document.body ).html( cleanHTML );<br \/>\n<\/code>\n<\/p><\/blockquote>\n<p>Overall, Chickenfoot is a great extension to have. These few examples shown here only scratch the surface of what it&#8217;s capable of. <\/p>\n<p>Chickenfoot 1.0.7 <a href=\"http:\/\/groups.csail.mit.edu\/uid\/chickenfoot\/\">link<\/a><br \/>\njQuery <a href=\"http:\/\/www.jQuery.com\">link<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chickenfoot is a Firefox extension design for website automation. Chickenfoot is a Firefox extension that puts a programming environment in the browser&#8217;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, &hellip; <a href=\"https:\/\/bateru.com\/news\/2010\/06\/chickenfoot-mixxed-with-jquery\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Chickenfoot mixed with jQuery.<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[15,164,5,163],"class_list":["post-204","post","type-post","status-publish","format-standard","hentry","category-frontend-tech","tag-firefox","tag-javascript","tag-jquery","tag-software"],"_links":{"self":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/comments?post=204"}],"version-history":[{"count":19,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/204\/revisions"}],"predecessor-version":[{"id":223,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/204\/revisions\/223"}],"wp:attachment":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/media?parent=204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/categories?post=204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/tags?post=204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}