The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Wiki Shell Scripting for MouseHole

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Wiki Shell Scripting for MouseHole Posted: Sep 22, 2005 6:59 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Wiki Shell Scripting for MouseHole
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

A wiki. That stores scripts. Run them from the URL. You have a personal Yubnub. This idea is Jake Donham’s and he dropped in on the MouseHole list a few weeks ago. My incarnation of his script is called MouseCommand.

To give you an idea of what’s possible, a few recipes du jour. For best effect in Firefox, go to about:config and set keyword.URL to http://127.0.0.1:37004/cmd/. Restart Firefox and make sure MouseHole is running and MouseCommand is installed.

del

A simple redirect to a del.icio.us tag.

 location "http://del.icio.us/tag/#{args.join '+'}" 

date

Display the system date and time. Arguments optionally passed into String#strftime.

 if args.empty?
   Time.now.to_s
 else
   Time.now.strftime( args.join( ' ' ) )
 end

url

For debugging. Pass another command in (try: url date or url del ruby) and get a dump of the headers and content generated by that command.

 run( args.join '/' ) rescue nil
 body = "

" response.header.map do |k,v| body += k + ": " + v + "
" end body + "

#{ response.body }
"

links

Make a list of links for a given URL.

 body = "
    " doc = read_xhtml_from "http://#{ args.join '/' }" doc.each_element( "//a" ) do |link| if link.attributes['href'] body += "
  • #{ link.attributes['href'] }
  • " end end body + "
"

If you have MouseCommand setup as keyword.URL, you can also type new shortcut to create a new command with the name shortcut. Also, list all to see your command list and edit shortcut to… you know… (Again, credit goes to Jared. A bunch of useful command ideas is elsewhere.)

Read: Wiki Shell Scripting for MouseHole

Topic: Now This Is How You Report An Error Previous Topic   Next Topic Topic: Ruby and Rails Bullet Points

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use