<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>a.muse: Browser Bar for mouseHole</title>
    <link>http://www.jessirae.com/blog/articles/2007/04/24/browser-bar-for-mousehole</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Browser Bar for mouseHole</title>
      <description>Add the following line to any of your user scripts in your &lt;code&gt;.mouseHole&lt;/code&gt; folder to add a browser bar at the top of every page your view with &lt;a href="http://code.whytheluckystiff.net/mouseHole/"&gt;mouseHole;&lt;/a&gt; like this&amp;#8230;
&lt;pre&gt;&lt;code&gt;def rewrite(page)
  document.search('//a[@href]') do |link|
    href = URI(link.attributes['href']) rescue nil
    next unless href &amp;#38;&amp;#38; href.host &amp;#38;&amp;#38; href.host != page.location.host
    link.after '&amp;lt;span style="font-size:8px"&amp;gt;[' + href.host + ']&amp;lt;/span&amp;gt;'
  end

#add the following line 
  document.search("body").prepend("&amp;lt;a href=\"http://del.icio.us/jowensbysandifer\"&amp;gt;" 
  +"&amp;lt;img src=\"http://127.0.0.1:3704/doorway/static/images/delicious.gif\" /&amp;gt;" 
  +"&amp;lt;/a&amp;gt;")
#just include your links to your favorite sites and you can check them... 
#   no matter where you are

end&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Oh and don&amp;#8217;t forget to place any icons in the static/images folder in your mouseHole application.&lt;/p&gt;


	&lt;p&gt;&lt;del&gt;-Teehe!  And if I knew how to get the url to the script, I could submit sites to del.icio.us (or whatever site I wanted) via javascript&amp;#8230; but that might be dangerous!&lt;/del&gt;-&lt;/p&gt;
&lt;p&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;:&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s how to submit a site to del.icio.us via the browser bar by getting the page url.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;Step 1&lt;/em&gt;: save the request in proxyhandler.rb as &lt;code&gt;$request&lt;/code&gt;.  A global&amp;#8230; bad I know :-(
I&amp;#8217;m still figuring out how mouseHole works.  Maybe the best thing to do would be to write the value out to the database?&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;Step 2&lt;/em&gt;: add submit html to a user script or create a new one (I call mine &lt;code&gt;browserbar.rb&lt;/code&gt;), like this&amp;#8230;&lt;/p&gt;


&lt;code&gt;&lt;pre&gt;
document.search("body").prepend("&amp;lt;a href=\"http://del.icio.us/jowensbysandifer?url=" 
+ $request.to_s + "&amp;#38;submit=save&amp;#38;jump=no\"&amp;gt;" 
+" &amp;lt;img src=\"http://127.0.0.1:3704/doorway/static/images/delicious.gif\" /&amp;gt;&amp;lt;/a&amp;gt;")
&lt;/pre&gt;&lt;/code&gt;

	&lt;p&gt;&lt;em&gt;Step 3&lt;/em&gt;: Restart mouseHole.&lt;/p&gt;</description>
      <pubDate>Tue, 24 Apr 2007 18:06:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:af7cf2a8-404d-41f1-8737-b6b0f2f53417</guid>
      <author>Jessica</author>
      <link>http://www.jessirae.com/blog/articles/2007/04/24/browser-bar-for-mousehole</link>
      <category>technology</category>
      <category>ruby &amp; rails</category>
      <category>script</category>
      <category>proxy</category>
      <category>browser</category>
      <category>ruby</category>
      <category>mouseHole</category>
      <trackback:ping>http://www.jessirae.com/blog/articles/trackback/12697</trackback:ping>
    </item>
  </channel>
</rss>

