<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WebServiceable &#187; JQuery</title>
	<atom:link href="http://webserviceable.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://webserviceable.com</link>
	<description>Mashups, APIs, Custom APIs. Information Shared.</description>
	<lastBuildDate>Mon, 23 Nov 2009 19:10:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Create a GreaseMonkey Script using JQuery and SelectorGadget</title>
		<link>http://webserviceable.com/2009/02/27/how-to-create-a-greasemonkey-script-using-jquery-and-selectorgadget/</link>
		<comments>http://webserviceable.com/2009/02/27/how-to-create-a-greasemonkey-script-using-jquery-and-selectorgadget/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 21:16:13 +0000</pubDate>
		<dc:creator>electBlake</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[GreaseMonkey]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[SelectorGadget]]></category>
		<category><![CDATA[TechCrunch]]></category>

		<guid isPermaLink="false">http://webserviceable.com/?p=109</guid>
		<description><![CDATA[Hello Hello,
I am here again, only an hour after I originally posted about this great new tool to give you a tutorial I quickly wrapped up about using the SelectorGadget Bookmarklet Tool and JQuery to create a simple GreaseMonkey userscript.
SelectorGadget Background
SelectorGadget is a great new bookmarklet tool that you can use on any website to [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><img style="float: left; margin-left: 10px; margin-right: 10px;" src="http://theappslab.com/wp-content/uploads/2009/01/inspector-gadget.jpg" alt="" />Hello Hello,</p>
<p>I am here again, only an hour after I originally posted about this great new tool to give you a tutorial I quickly wrapped up about using the SelectorGadget Bookmarklet Tool and JQuery to create a simple GreaseMonkey userscript.</p>
<h3>SelectorGadget Background</h3>
<p>SelectorGadget is a great new bookmarklet tool that you can use on <em>any</em> website to select html elements on the page dynamically! The real power of SelectorGadget is that is that it automatically selects similar elements! So as you select what you want and don&#8217;t want, it will work towards selecting the exact elements on the page you want, for example the titles of blog posts! (I&#8217;ll give a tutorial below)</p>
<p>The Official Description is (lifted from the official homepage)</p>
<blockquote><p>&#8220;SelectorGadget is an open source bookmarklet that makes <a href="http://www.w3.org/TR/CSS2/selector.html" target="_blank" >CSS selector</a> generation and discovery on complicated sites a breeze. Just drag the bookmarklet to your bookmark bar, then go to any page and press it. A box will open in the bottom right of the website. Click on a page element that you would like your selector to match (it will turn green). SelectorGadget will then generate a minimal CSS selector for that element, and will highlight (yellow) everything that is matched by the selector.&#8221;</p>
</blockquote>
<p>If you go to the SelectorGadget Homepage you can see a great tutorial video on the basics on using SelectorGadget, I&#8217;ll quickly run through the minimal installation process to save you click around until you want to do your additional research <img src='http://webserviceable.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-109"></span></p>
<h4>How to Install SelectorGadget</h4>
<ol>
<li>Go to the SelectorGadget Homepage</li>
<li>Scroll to the bottom of the page and find the  link &#8220;Drag this link to your bookmark bar: <a href="javascript:(function(){var%20s=document.createElement('div');s.innerHTML='Loading...';s.style.color='black';s.style.padding='20px';s.style.position='fixed';s.style.zIndex='9999';s.style.fontSize='3.0em';s.style.border='2px%20solid%20black';s.style.right='40px';s.style.top='40px';s.setAttribute('class','selector_gadget_loading');s.style.background='white';document.body.appendChild(s);s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('src','http://www.selectorgadget.com/stable/lib/selectorgadget.js?raw=true" target="_blank" );document.body.appendChild(s);})();">SelectorGadget</a>&#8220;<em><br />
 note: you can drag the link above into your toolbar, but it is highly recommended you go to the official website to get the latest version.</em></li>
<li>Drag the link &#8220;SelectGadget&#8221; into your toolbar.</li>
<li>You should now see a link that looks like: <img class="alignnone size-full wp-image-111" title="SelectorGadget Bookmarklet in Toolbar" src="http://webserviceable.com/wp-content/uploads/2009/02/picture-18.png" alt="SelectorGadget Bookmarklet in Toolbar" width="107" height="30" /></li>
<li>Your good to go!</li>
</ol>
<p>Ok, now that you have the bookmarklet installed, lets take a look at a tutorial to get your started.</p>
<h3>SelectorGadget + JQuery Tutorial to Create a GreaseMonkey Script</h3>
<p>GreaseMonkey is a platform for installing little javascript applications to change the websites you view. GreaseMonkey can all links to download files located on a page, and can even pre-load information or load widget from other sites entirely!</p>
<p>If your curious about GreaseMonkey you can <a href="http://diveintogreasemonkey.org/install/what-is-greasemonkey.html" target="_blank" title="What is GreaseMonkey?" >read about what it is here</a> or just <a target="_blank" title="Install GreaseMonkey" href="https://addons.mozilla.org/en-US/firefox/addon/748">install the firefox plugin here<br />
 </a></p>
<h4><strong>Tutorial Goal</strong></h4>
<p>In this tutorial we are going to add google search icons to each post listed on TechCrunch.com</p>
<h4><strong>The TechCrunch Improved View GreaseMonkey Tutorial<br />
 </strong></h4>
<ol>
<li>
<p><strong>Browse to TechCrunch.com and Click on the SelectorGadget Bookmarklet</strong></p>
<p><strong> </strong>You should see the SelectorGadget widget on your screen like so: <img class="alignnone size-full wp-image-112" title="SelectGadget Widget" src="http://webserviceable.com/wp-content/uploads/2009/02/picture-19.png" alt="SelectGadget Widget" width="435" height="35" /></p>
</li>
<li>
<p><strong>Now Click on the title of a news post, and you should see it turn green to indicate it&#8217;s been selected.</strong></p>
<p>You will also see yellow highlights on the screen, these are the elements that SelectorGadget&#8217;s engine believes you want to select also:</p>
<p><img class="alignnone size-full wp-image-113" title="picture-12" src="http://webserviceable.com/wp-content/uploads/2009/02/picture-12.png" alt="picture-12" width="470" height="339" /></p>
</li>
<li>
<p><strong>We only want the titles for this tutorial so lets hover over one of the highlighten areas and click to remove them.</strong></p>
<p>You&#8217;ll notice that it turns orange to show that it will be taken out of the SelectorGadget selection and the engine should re-adjust its auto-selection to meet your needs:</p>
<p><img class="alignnone size-full wp-image-114" title="picture-13" src="http://webserviceable.com/wp-content/uploads/2009/02/picture-13.png" alt="picture-13" width="452" height="74" /></p>
</li>
<li>
<p>Now you should have only the titles selected!</p>
<p><img class="alignnone size-full wp-image-115" title="picture-14" src="http://webserviceable.com/wp-content/uploads/2009/02/picture-14.png" alt="picture-14" width="459" height="454" /></p>
</li>
<li>
<p><strong>Now you have a clean CSS Selector you can use.</strong></p>
<p>The SelectorGadget Widget now gives a very clean CSS Selector you can use in ANY of you applications, ours is: <br />
 <strong>.excerpt_header a</strong></p>
<p><img class="alignnone size-full wp-image-116" title="picture-15" src="http://webserviceable.com/wp-content/uploads/2009/02/picture-15.png" alt="picture-15" width="491" height="27" /></p>
<p>In my original post I explained some of the <a href="http://webserviceable.com/2009/02/27/introducing-selectorgadget-dapper-style-dom-selection-for-jquery-javascript-and-beyond/" >uses I could imagine for SelectorGadget</a>, feel free to check those out now <img src='http://webserviceable.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</li>
<li>
<p><strong>This tutorials goal focused on the Widget itself, so I won&#8217;t go into ALOT of depth with the GreaseMonkey widget, but I&#8217;ll explain how this selector is used in a userscript <img src='http://webserviceable.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<p>I promised JQuery for this tutorial, so I am going to use the following simple integration I found here: http://internetducttape.com/2008/05/08/greasemonkey-ninja-jquery/</p>
</li>
<li>
<p><strong>The Template for this Userscript can be found in:<a href="http://webserviceable.com/dev/jquery-template.js" > jquery-template.js</a></strong></p>
<p><strong> </strong>The important section (and the only section we really need to change is):</p>
<p>// All your GM code must be inside this function<br />
 function letsJQuery() {</p>
<p><em><strong>// CODE GOES HERE</strong></em></p>
<p>}</p>
</li>
<li>
<p><strong>Now lets grab the titles of the page using jquery:</strong></p>
<p>titles = $(&#8217;.excerpt_header a&#8217;);</p>
</li>
<li>
<p><strong>Now that we have an array of the titles in JQuery, we can add a link!</strong></p>
<p>First we pull the text from the title of the news post, and then add a little google icon which links to the google search for that news post:</p>
<p>$(titles).each(function(i) {<br />
 title_text = $(this).attr(&#8217;innerHTML&#8217;);<br />
 $(this).after(&#8217;&lt;a style=&#8221;margin:5px;&#8221; target=&#8221;_blank&#8221; href=&#8221;http://google.com/search?q=&#8217;+title_text+&#8217;&#8221;&gt;&lt;img src=&#8221;http://www.mindzilla.com/grabicon.cgi/google.png?uri=google.com&amp;format=png&#8221; alt=&#8221;Search on Google.com&#8221; /&gt;&lt;/a&gt;&#8217;);<br />
 }</p>
<p>(you&#8217;ll notice I use a webservice to grab google&#8217;s icon, I&#8217;m lazy and I think for this tutorial its fine, this script is not ment for production use)</p>
</li>
<li>
<p><strong>Now, if you install this user script, you can see that it adds google links to all of the titles at TechCrunch.com!</strong></p>
</li>
<li>
<p><strong>You can install this tutorials userscript by browsing to: <a href="http://webserviceable.com/dev/techcrunch_improved_view.user.js" >webserviceable.com/dev/techcrunch_improved_view.user.js</a></strong></p>
<p>You&#8217;ll know see little google icons on every post at techcrunch.com!</p>
<p><img class="alignnone size-full wp-image-120" title="SelectorGadget + JQuery + GreaseMonkey on TechCrunch.com!" src="http://webserviceable.com/wp-content/uploads/2009/02/picture-20.png" alt="SelectorGadget + JQuery + GreaseMonkey on TechCrunch.com!" width="606" height="102" /></p>
</li>
<li>
<p><strong>Oops! If you were following the tutorial exactly, you&#8217;ll have noticed that the script doens&#8217;t work on the post view.</strong></p>
<p>We can fix that in a snap! Simply repeat the steps above but on any of the post pages at TechCrunch.com, and you will be given a css selector for the title on post pages that looks like this:</p>
<p><img class="alignnone size-full wp-image-119" title="picture-17" src="http://webserviceable.com/wp-content/uploads/2009/02/picture-17.png" alt="picture-17" width="416" height="31" /></p>
</li>
<li>
<h4><strong>Now we add this selector into our script in the exact same way we did before and we have a working script!</strong></h4>
</li>
</ol>
<p>Ok, so thats it! Enjoy the tutorial, and leave any comments if you want some clarification. Be sure to checkout the final version of the userscript <a href="http://webserviceable.com/dev/techcrunch_improved_view.user.js" >techcrunch_improved_view.user.js</a></p>
<p><strong>as a round-up I&#8217;ll make a nice list of the technologies mentioned and the links to learn about them.</strong></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong> </strong></p>
<h4><strong>SelectorGadget</strong></h4>
<p>An innovating and intelligent HTML selecting engine for generating dynamic css selectors</p>
<ul>
<li>Homepage: <a href="http://www.selectorgadget.com" target="_blank" >http://www.selectorgadget.com</a></li>
<li>Basic How to Video: <a href="http://www.selectorgadget.com" target="_blank" >http://www.selectorgadget.com</a></li>
<li><a href="http://webserviceable.com/2009/02/27/introducing-selectorgadget-dapper-style-dom-selection-for-jquery-javascript-and-beyond/" title="SelectorGadget on Webserviceable.com" >Initial Post on Webserviceable.com &#8211; Overview, Ideas, Foreseeable Uses</a></li>
</ul>
<h4><strong>JQuery</strong></h4>
<p><strong> </strong>Very popular javascript framework</p>
<ul>
<li>Homepage: <a href="http://jquery.com" target="_blank" >http://jquery.com</a></li>
<li>Documentation: <a href="http://docs.jquery.com" target="_blank" >http://docs.jquery.com</a></li>
<li>Direct Download: <a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.min.js&amp;downloadBtn=" target="_blank" >http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.min.js&amp;downloadBtn=</a></li>
<li>JQuery on Google&#8217;s Ajaxlibs &#8211; <a href="http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery" target="_blank" >http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery</a></li>
<li>GreaseMonkey and JQuery &#8211; <a href="http://internetducttape.com/2008/05/08/greasemonkey-ninja-jquery/" target="_blank" >http://internetducttape.com/2008/05/08/greasemonkey-ninja-jquery/</a></li>
</ul>
<h4><strong>GreaseMonkey</strong></h4>
<p>A very cool javascript plugin engine for your browser that allows you to add functionality/information to any website.</p>
<ul>
<li>Homepage: <a href="http://diveintogreasemonkey.org/" target="_blank" >http://diveintogreasemonkey.org/</a></li>
<li>Blog: <a href="http://www.greasespot.net/" target="_blank" >http://www.greasespot.net/</a></li>
<li>Wiki: <a href="http://wiki.greasespot.net/Main_Page" target="_blank" >http://wiki.greasespot.net/Main_Page</a></li>
<li>Direct Download: <a href="https://addons.mozilla.org/en-US/firefox/addon/748" target="_blank" >https://addons.mozilla.org/en-US/firefox/addon/748</a></li>
<li>GreaseMonkey and JQuery: <a href="http://internetducttape.com/2008/05/08/greasemonkey-ninja-jquery/" target="_blank" >http://internetducttape.com/2008/05/08/greasemonkey-ninja-jquery/</a></li>
</ul>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://webserviceable.com/2009/02/27/how-to-create-a-greasemonkey-script-using-jquery-and-selectorgadget/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Introducing SelectorGadget &#8211; Dapper Style DOM Selection for JQuery, Javascript, and beyond</title>
		<link>http://webserviceable.com/2009/02/27/introducing-selectorgadget-dapper-style-dom-selection-for-jquery-javascript-and-beyond/</link>
		<comments>http://webserviceable.com/2009/02/27/introducing-selectorgadget-dapper-style-dom-selection-for-jquery-javascript-and-beyond/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 18:30:57 +0000</pubDate>
		<dc:creator>electBlake</dc:creator>
				<category><![CDATA[Data Extraction]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Bookmarklet]]></category>
		<category><![CDATA[Dapper.net]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[SelectorGadget]]></category>

		<guid isPermaLink="false">http://webserviceable.com/?p=105</guid>
		<description><![CDATA[+  = ?
I caught a jquery tweet today that linked me to an interesting little helper bookmarklet called &#8220;SelectorGadget&#8221;.
&#8220;SelectorGadget is an open source bookmarklet that makes CSS selector generation and discovery on complicated sites a breeze.&#8221;

SelectorGadget, is a very easy to use bookmarklet that can be used on any website of your choosing (Although [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><img src="http://theappslab.com/wp-content/uploads/2009/01/inspector-gadget.jpg" alt="InspectorGadget" width="173" height="200" /><strong><span style="font-size: x-large;">+</span></strong> <img class="alignnone size-full wp-image-106" title="JQuery" src="http://webserviceable.com/wp-content/uploads/2009/02/picture-8.png" alt="JQuery" width="236" height="78" /> <strong><span style="font-size: x-large;">= ?</span></strong><strong></strong></p>
<p>I caught a <a href="http://twitter.com/jquery/status/1258925790" target="_blank" >jquery tweet</a> today that linked me to an interesting little helper bookmarklet called &#8220;SelectorGadget&#8221;.</p>
<blockquote><p>&#8220;SelectorGadget is an open source bookmarklet that makes <a href="http://www.w3.org/TR/CSS2/selector.html" target="_blank" >CSS selector</a> generation and discovery on complicated sites a breeze.&#8221;</p>
</blockquote>
<p><a href="http://www.selectorgadget.com" target="_blank" title="SelectorGadget" ><strong>SelectorGadget</strong></a>, is a very easy to use bookmarklet that can be used on any website of your choosing (Although someone in the comments DID have a problem with scraping a site that is NTFW <img src='http://webserviceable.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p>To get started with <strong>SelectorGadget</strong>, <a href="http://www.selectorgadget.com" target="_blank" >head over to their humble website</a>, and install the bookmarklet and watch the video. Anyone with experience in Data Extraction (Hpricot or Beautiful Soup &#8211; as the website suggests), will immedately see the benefits of this little application.</p>
<p>With apparent support from JQuery, and its <a href="http://github.com/iterationlabs/selectorgadget/tree/master" target="_blank" title="SelectorGadget @ github.com" >open-source repository over at github</a>, I think SelectorGadget will be able to spawn alot of interest within the various Javascript and DOM Selection/Extraction camp&#8217;s around the internet.</p>
<p>Some ideas for you guys to dig your teeth into after the fold.</p>
<p><span id="more-105"></span></p>
<h3>My Forseeable Uses for SelectorGadget and its Algorythms:</h3>
<ol>
<li>Speed up creation of <a href="http://en.wikipedia.org/wiki/Greasemonkey" target="_blank" title="GreaseMonkey" >GreaseMonkey</a> userscripts(<a href="http://userscripts.org" target="_blank" title="GreaseMonkey Userscripts.org" >.org</a>) for those of us who rely on JQuery for our javascript prowess.</li>
<li>Make DOM Selection in your own Javascript Applications (jquery included), MUCH MUCH easier</li>
<li>Dynamic JQuery plugins for data extraction &#8211; Make more versitile plugins to manage dynamic datasets.
<ul>
<li>For Example:
<ul>
<li>Creation a plugin that adds dom to specific element types of a page (mp3 player to mp3 links)</li>
<li>Generalize the selection of the mp3 links</li>
<li>Drop in mp3 player plugin to any page w/out any need to initilize</li>
</ul>
</li>
</ul>
</li>
<li>Creation of your own <a href="http://dapper.net" target="_blank" title="Dapper.net" >Dapper Engine</a>????????
<ul>
<li>For instance if you could (hypothetically) get jaxer running this javascript selection engine. Then maybe&#8230; you could be running a serverside DOM Selector engine with native ajax-scraping abilities&#8230;Hrrmm&#8230;</li>
</ul>
</li>
<li>Quick Ruby Data Extraction &amp; Screen Scraping
<ul>
<li><a href="http://wiki.github.com/why/hpricot" target="_blank" title="Ruby's Hpricot gem" >Hpricot</a>, or better yet <a href="http://github.com/scrubber/scrubyt" target="_blank" >scrubyt</a>, OR even better still <a href="http://github.com/scrubber/scrubyt/tree/skimr" target="_blank" >skimr</a> (the re-factored scrubyt for those of you who have been paying attention)</li>
</ul>
</li>
<li>SelectorGadget to <a href="http://code.google.com/p/phpquery/" target="_blank" title="phpQuery - a php port of JQuery" >phpQuery</a> ? &#8211; phpQuery is a dom selector engine for php designed to be a port of JQuery to php. Its pretty good but a little slow for my liking.</li>
</ol>
<h3>The Death of PHP in Data Extraction</h3>
<p>Yes, I am calling it. This is not breaking news as Ruby&#8217;s scrubyt (and its driving forces WWW:Mechanize and Hpricot), have been dominating the &#8220;custom api creation&#8221; process for awhile now. Still, php is so common and easy to get up and running its hard for me drop it all together.</p>
<p>Software like SelectorGadget gives me even more reason to move away from php and work on my Ruby development more. As an interim solution (in the interest of time) I imagine myself using Ruby for my data and php for my presentation.</p>
<p>OR, if I can finally get a solid native jaxer server running I could simply use my javascript skills to properly deploy my data extraction javascript applications. (If your a jaxer master, please message me, I&#8217;ve tried numerous times with limited success)</p>
<p>Until I am a ruby master (which might take time as I&#8217;m learning far too many languages atm), I am going to see what I can hack out of the SelectorGadget engine. Its algorithms might unlock a very cool selector engine for php (aka an improved or refactored phpQuery <img src='http://webserviceable.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<p><br class="spacer_" /></p>
<p>Anyway, I think SelectorGadget has ALOT of promise and I see this accomplishment echoing through a lot of different technologies and software. I know I am going to dig into it and see what I can do. I&#8217;ll be sure to report all of my findings to you good people.</p>
<p>Happy api&#8217;ing.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://webserviceable.com/2009/02/27/introducing-selectorgadget-dapper-style-dom-selection-for-jquery-javascript-and-beyond/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
