Browser Bar for mouseHole
.mouseHole folder to add a browser bar at the top of every page your view with mouseHole; like this…
def rewrite(page)
document.search('//a[@href]') do |link|
href = URI(link.attributes['href']) rescue nil
next unless href && href.host && href.host != page.location.host
link.after '<span style="font-size:8px">[' + href.host + ']</span>'
end
#add the following line
document.search("body").prepend("<a href=\"http://del.icio.us/jowensbysandifer\">"
+"<img src=\"http://127.0.0.1:3704/doorway/static/images/delicious.gif\" />"
+"</a>")
#just include your links to your favorite sites and you can check them...
# no matter where you are
end
Oh and don’t forget to place any icons in the static/images folder in your mouseHole application.
-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… but that might be dangerous!-
UPDATE:
Here’s how to submit a site to del.icio.us via the browser bar by getting the page url.
Step 1: save the request in proxyhandler.rb as $request. A global… bad I know :-(
I’m still figuring out how mouseHole works. Maybe the best thing to do would be to write the value out to the database?
Step 2: add submit html to a user script or create a new one (I call mine browserbar.rb), like this…
document.search("body").prepend("<a href=\"http://del.icio.us/jowensbysandifer?url="
+ $request.to_s + "&submit=save&jump=no\">"
+" <img src=\"http://127.0.0.1:3704/doorway/static/images/delicious.gif\" /></a>")
Step 3: Restart mouseHole.
Trackbacks
Use the following link to trackback from your own site:
/blog/articles/trackback/12697
