<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4843261471872272266</id><updated>2024-11-01T22:18:03.650+11:00</updated><category term="blogging"/><category term="browser"/><category term="css selectors"/><category term="delicious"/><category term="development"/><category term="dom"/><category term="facebook"/><category term="firefox"/><category term="flickr"/><category term="flock"/><category term="gmail"/><category term="haml"/><category term="html"/><category term="josh price"/><category term="jquery"/><category term="jruby"/><category term="mac"/><category term="macports"/><category term="personal seo"/><category term="safari"/><category term="selenium"/><category term="social"/><category term="tumblr"/><category term="twitter"/><category term="web 2.0"/><category term="xpath"/><title type='text'>Robot Overlords</title><subtitle type='html'>Let Josh Price prepare you for when the machines take over.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://robotoverlords.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4843261471872272266/posts/default'/><link rel='alternate' type='text/html' href='http://robotoverlords.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Josh Price</name><uri>http://www.blogger.com/profile/16249977459828254298</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4843261471872272266.post-4368882195684603399</id><published>2009-02-27T10:17:00.012+11:00</published><updated>2009-02-27T13:04:34.375+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="css selectors"/><category scheme="http://www.blogger.com/atom/ns#" term="dom"/><category scheme="http://www.blogger.com/atom/ns#" term="haml"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="selenium"/><category scheme="http://www.blogger.com/atom/ns#" term="xpath"/><title type='text'>CSS selectors everywhere: SelectorGadget</title><content type='html'>Pulling information out of a web page is a pretty common thing to want to do.  You might want style, scrape or test a particular section of HTML in a page.&lt;br /&gt;&lt;br /&gt;Over the years I&#39;ve used all sorts of techniques for extracting content out of an HTML DOM.  Regexes, XPath, and other things you probably don&#39;t want to know about...&lt;br /&gt;&lt;br /&gt;Recently I&#39;ve come to realise that &lt;span style=&quot;font-weight: bold;&quot;&gt;CSS selectors are the canonical way for navigating the DOM&lt;/span&gt; in the specific case of HTML.  What&#39;s nice is that a lot of tools use these, and you can reduce the impedance mismatch between other selection techniques by using CSS selectors everywhere.  You may also be able to share your selectors between designers, devs and testers.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Reducing the impedance mismatch&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Some situations I use CSS selectors&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;CSS&lt;/span&gt; - OK well this one&#39;s pretty obvious&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;a href=&quot;http://seleniumhq.org/&quot;&gt;Selenium&lt;/a&gt; tests&lt;/span&gt; - Traditionally most people either use the default element id selector or (for anything more complex) XPath selectors.  XPath is great for XML but CSS selectors have a syntactic edge for the standard HTML attributes.  Just compare the readability of  &lt;span style=&quot;font-family:courier new;&quot;&gt;&lt;span style=&quot;color: rgb(102, 0, 204);&quot;&gt;div#top.selected a&lt;/span&gt;&lt;span style=&quot;font-family:arial;&quot;&gt;  &lt;span style=&quot;font-family:times new roman;&quot;&gt;with&lt;/span&gt; &lt;span style=&quot;color: rgb(102, 0, 204);font-family:courier new;&quot; &gt;//div[id=&#39;top&#39; class=&#39;selected&#39;]//a&lt;/span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;jQuery&lt;/span&gt; - In my opinion the best Javascript framework out there. Everything in jQuery is driven entirely by CSS selectors.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://haml.hamptoncatlin.com/&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;HAML&lt;/span&gt;&lt;/a&gt; - If you&#39;re lucky enough to be using &lt;a href=&quot;http://haml.hamptoncatlin.com/&quot;&gt;HAML&lt;/a&gt; you&#39;ll notice how the structure of your template mimics the CSS selectors. This makes it much easier to see how&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Some of the benefits of CSS selectors:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Simple&lt;/li&gt;&lt;li&gt;Terse&lt;/li&gt;&lt;li&gt;Readable&lt;/li&gt;&lt;li&gt;Universal&lt;/li&gt;&lt;li&gt;Geared specifically for HTML&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tools for building and testing expressions&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.selectorgadget.com/&quot;&gt;SelectorGadget&lt;/a&gt; looks like a great tool for figuring out more complex selectors if you&#39;re not as familiar with the syntax as you&#39;d like to be.  Why not try it out?&lt;br /&gt;&lt;br /&gt;One other way I like to debug CSS selector expressions is in the &lt;a href=&quot;http://getfirebug.com/&quot;&gt;Firebug&lt;/a&gt; console.  Assuming that jQuery is loaded in the page, you can use the console to interact directly with the page:&lt;br /&gt;&lt;br /&gt;Try this. Load the&lt;a href=&quot;http://jquery.com/&quot;&gt; jQuery&lt;/a&gt; site and open your Firebug console and type:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;$(&#39;a&#39;).css(&#39;border&#39;,&#39;1px solid red&#39;)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This should highlight all the links in the page. Substitute &#39;a&#39; for any CSS expression and you&#39;ll be able to see what is selected by that expression.  (Don&#39;t forget to refresh the page though!)</content><link rel='replies' type='application/atom+xml' href='http://robotoverlords.blogspot.com/feeds/4368882195684603399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4843261471872272266/4368882195684603399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4843261471872272266/posts/default/4368882195684603399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4843261471872272266/posts/default/4368882195684603399'/><link rel='alternate' type='text/html' href='http://robotoverlords.blogspot.com/2009/02/css-selectors-everywhere-selectorgadget.html' title='CSS selectors everywhere: SelectorGadget'/><author><name>Josh Price</name><uri>http://www.blogger.com/profile/16249977459828254298</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4843261471872272266.post-7627675987331020505</id><published>2009-02-13T11:56:00.003+11:00</published><updated>2009-02-13T12:30:11.952+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="development"/><category scheme="http://www.blogger.com/atom/ns#" term="jruby"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="macports"/><title type='text'>JRuby 1.1.6 now available on MacPorts</title><content type='html'>I really love how easy &lt;a href=&quot;http://www.macports.org/&quot;&gt;MacPorts&lt;/a&gt; makes installing packages on the Mac. If you own a Mac and develop software you are probably already using MacPorts. If you don&#39;t you should take a look and see what you&#39;re missing.&lt;br /&gt;&lt;br /&gt;But sometimes the packages are a little out of date. This happened to me with &lt;a href=&quot;http://www.selenic.com/mercurial&quot;&gt;Mercurial&lt;/a&gt; when 1.0 was released, and I&#39;m sure it happens to others from time to time.  Next time it happens, you might just be able to do something about it...&lt;br /&gt;&lt;br /&gt;Yesterday I reinstalled &lt;a href=&quot;http://www.jruby.org/&quot;&gt;JRuby&lt;/a&gt; from MacPorts but I got version 1.1.5 instead of version 1.1.6 which I was expecting. &lt;a href=&quot;http://blog.headius.com/&quot;&gt;Charles&lt;/a&gt; suggested via twitter that I chase it up, so I spent the morning trying to get the JRuby port upgraded to the latest version so everyone could share the love.&lt;br /&gt;&lt;br /&gt;Here&#39;s what I discovered:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The 1.1.6 port &lt;a href=&quot;https://trac.macports.org/ticket/17699&quot;&gt;upgrade ticket&lt;/a&gt; had been filed a while back but wasn&#39;t closed and had apparently fallen through the cracks&lt;br /&gt;&lt;/li&gt;&lt;li&gt;When raising a ticket for a port upgrade attach a unified diff, not the whole portfile (this makes it easy to see what changed).  &lt;a href=&quot;http://guide.macports.org/#development.patches.portfile&quot;&gt;Follow these steps&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If something is out of date then an email to the &lt;a href=&quot;http://www.macports.org/contact.php&quot;&gt;macports-dev&lt;/a&gt; mailing list will probably ensure it gets done&lt;/li&gt;&lt;/ol&gt;I jumped on the MacPorts IRC channel (&lt;a href=&quot;http://www.macports.org/contact.php&quot;&gt;#MacPorts&lt;/a&gt;) and the friendly guys gave me the above advice and made the change almost immediately.&lt;br /&gt;&lt;br /&gt;How&#39;s that for service?</content><link rel='replies' type='application/atom+xml' href='http://robotoverlords.blogspot.com/feeds/7627675987331020505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4843261471872272266/7627675987331020505' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4843261471872272266/posts/default/7627675987331020505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4843261471872272266/posts/default/7627675987331020505'/><link rel='alternate' type='text/html' href='http://robotoverlords.blogspot.com/2009/02/jruby-116-now-available-on-macports.html' title='JRuby 1.1.6 now available on MacPorts'/><author><name>Josh Price</name><uri>http://www.blogger.com/profile/16249977459828254298</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4843261471872272266.post-3359558905134169125</id><published>2009-01-21T16:05:00.003+11:00</published><updated>2009-01-21T16:48:01.190+11:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blogging"/><category scheme="http://www.blogger.com/atom/ns#" term="josh price"/><category scheme="http://www.blogger.com/atom/ns#" term="personal seo"/><category scheme="http://www.blogger.com/atom/ns#" term="tumblr"/><category scheme="http://www.blogger.com/atom/ns#" term="twitter"/><title type='text'>Must blog more in 2009</title><content type='html'>I&#39;ve always felt fairly ambivalent about blogging.  So thus far I haven&#39;t done much of it.  Last year I discovered and really enjoyed the &#39;micro-blogging&#39; experience of Twitter.  Having an iPhone made it all the more visceral and now it&#39;s my most-used iPhone app by a long way.&lt;br /&gt;&lt;br /&gt;Twitter has made me think differently about blogging.  I really love the instant and micro nature of Twitter making almost like a public notepad recording my smallest of thoughts.  This style really works well for the way my brain actually works. (OK well it could also be the ADD).&lt;br /&gt;&lt;br /&gt;Now I&#39;m wanting to post things that have a little more meat on their bones than 140 characters allows.  I also want to practice my writing, since I kind of enjoy, but don&#39;t do nearly enough of it.&lt;br /&gt;&lt;br /&gt;Another reason to blog more is to raise my digital profile.  I recently (out of curiousity more than vanity) setup a google alert on my own name.  The other Josh Price&#39;s out there who appear in this are an interesting bunch of fellows, and I wouldn&#39;t want anyone googling me and getting them if you know what I mean.  (Apologies to the other Josh Price&#39;s if you&#39;re reading this....).  So I&#39;m going to attempt to raise my level of personal SEO.  Since I own my own .com domain then this should be pretty straightforward.&lt;br /&gt;&lt;br /&gt;I&#39;ve created a tumblr account as well which I&#39;m not yet sure what I&#39;ll use for.  It appears to fill the gap between Twitter and blog posts.&lt;br /&gt;&lt;br /&gt;The upshot of all of this is that I am committing to blogging more in 2009.  I expect you all to hold me to this.</content><link rel='replies' type='application/atom+xml' href='http://robotoverlords.blogspot.com/feeds/3359558905134169125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4843261471872272266/3359558905134169125' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4843261471872272266/posts/default/3359558905134169125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4843261471872272266/posts/default/3359558905134169125'/><link rel='alternate' type='text/html' href='http://robotoverlords.blogspot.com/2009/01/must-blog-more-in-2009.html' title='Must blog more in 2009'/><author><name>Josh Price</name><uri>http://www.blogger.com/profile/16249977459828254298</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4843261471872272266.post-4276585175671336221</id><published>2008-04-27T11:57:00.001+10:00</published><updated>2008-04-27T20:19:14.589+10:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="browser"/><category scheme="http://www.blogger.com/atom/ns#" term="delicious"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="firefox"/><category scheme="http://www.blogger.com/atom/ns#" term="flickr"/><category scheme="http://www.blogger.com/atom/ns#" term="flock"/><category scheme="http://www.blogger.com/atom/ns#" term="gmail"/><category scheme="http://www.blogger.com/atom/ns#" term="safari"/><category scheme="http://www.blogger.com/atom/ns#" term="social"/><category scheme="http://www.blogger.com/atom/ns#" term="web 2.0"/><title type='text'>Flock: a whole new browser experience</title><content type='html'>I&#39;ve been flicking between Firefox 3b5, Safari 3 and Opera on my Mac for a while now.  Today I found a brand new &quot;Social&quot; browser called &lt;a href=&quot;http://www.flock.com/&quot;&gt;Flock&lt;/a&gt;.  After a few minutes I had my &lt;a href=&quot;http://www.facebook.com/&quot;&gt;Facebook&lt;/a&gt; and &lt;a href=&quot;http://www.flickr.com/&quot;&gt;Flickr&lt;/a&gt; contacts listed in my sidebar.  I also connected my &lt;a href=&quot;http://www.gmail.com/&quot;&gt;Gmail&lt;/a&gt;, my blog and my delicious bookmarks.  Although I&#39;ve only touched the surface of what seems to be quite a lot of interesting social features and plugins, I&#39;ve come away rather impressed.&lt;br /&gt;&lt;br /&gt;The whole social experience seems to have come together in my Flock browser in a way that I had never considered.  My Facebook contacts are sorted by the most recent status updates.  The sidebar interface actually feels much cleaner and more organised than Facebook.  Flickr photos are presented across the top of my browser window, and changing streams is faster and more intuitive than Flickr.&lt;br /&gt;&lt;br /&gt;Flock appears to have all the standard browser features I&#39;ve gotten used to.  Probably because it&#39;s &lt;a href=&quot;http://www.flock.com/mozilla&quot;&gt;built on top of Firefox&lt;/a&gt;.  It also seems pretty snappy.  I&#39;m going to try it as my default browser and see how I like it.  It can&#39;t possibly crash as often as Firefox 3 beta 5...</content><link rel='replies' type='application/atom+xml' href='http://robotoverlords.blogspot.com/feeds/4276585175671336221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4843261471872272266/4276585175671336221' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4843261471872272266/posts/default/4276585175671336221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4843261471872272266/posts/default/4276585175671336221'/><link rel='alternate' type='text/html' href='http://robotoverlords.blogspot.com/2008/04/flock-provides-whole-new-browser.html' title='Flock: a whole new browser experience'/><author><name>Josh Price</name><uri>http://www.blogger.com/profile/16249977459828254298</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>