From why at hobix.com Tue May 16 01:18:33 2006 From: why at hobix.com (why the lucky stiff) Date: Mon, 15 May 2006 23:18:33 -0600 Subject: MouseHole 2.0 Beta -- totally rewritten!! Message-ID: <446960A9.4020007@hobix.com> Okay, who wants to help beta-test MouseHole 2? svn co http://code.whytheluckystiff.net/svn/mouseHole/trunk mouseHole Requires Camping and Mongrel. == Whoa! Speedier! I stripped MouseHole down to a bare proxy and started by speeding up the core itself. This was a very rigorous process. I coded a curl extension that would integrate tightly, but I didn't get enough gain out of it. I tried various scenarios with libtidy and libxml (also: xml-smart, teius.) I'm back to HTree and REXML. In the end, I just rewrote the proxy using Net::HTTP and Mongrel. It's actually doing much better. Partially due to resolv-replace and partially due to just replacing WEBrick::HTTPProxy. It's very efficient, fully streamed, all that. == Cleaner Scripts, Directories Previous versions had a bunch of directories in ~/.mouseHole. Now ~/.mouseHole just contains your user scripts and the database file. You can drop Camping apps right in this directory. Drop Tepee in there and you have a versioning wiki for MouseHole. Drop ParkPlace in there and you've got a torrent tracker/filesharing system. Traditional MouseHole scripts have changed slightly as well. The common example is this script which displays the alt tags for a few web comic sites: # Simple MouseHole 2.0 script, based on the Greasemonkey script # by Adam Vandenberg. His is GPL, so this is GPL. # class ComicAlt < MouseHole::App name "Comics Alt Text" namespace "http://adamv.com/greases/" description 'Shows the "hover text" for some comics on the page' version "0.3" + url("http://achewood.com/*") + url("http://*.achewood.com/*") + url("http://qwantz.com/*") + url("http://*.qwantz.com/*") COMICS = { "achewood" => '//img[starts-with(@src, "/comic.php?date=")]', "qwantz" => '//img[starts-with(@src, "http://www.qwantz.com/comics/")]', } # the pages flow through here def rewrite(page) whichSite, xpath = COMICS.detect do |key,| page.location.host.include? key end return unless whichSite comic = document.elements[xpath] return unless comic if comic.attributes['title'] div = Element.new 'div' div.attributes['className'] = 'msg' div.text = "(#{ comic.attributes['title'] })" comic.parent.insert_after comic, div end end end Notice the new URL matching syntax. + url("...") includes URLs for matching. - url("...") excludes URLs. I've also simplified the `rewrite' method. Previously, it received both the request and response objects. This made for a lot of information to sort through. Do you really need the request headers? The new Page class is geared for rewriters. The XHTML structure is contained in page.document. The URI is in page.location. There's also page.status, page.headers and page.converter (which contains methods specific to the content_type.) This simplification and renaming should help folks coming from Greasemonkey and cut down the amount of documentation needed to get MouseHole scripts going. == Caveats Lots of stuff is missing since I started over. The RSS feed, Lighttpd/Apache support, configuration of scripts, auto-installation. But it'll be coming together in the next few days. Ways to stay on top of MH2 development: * indian_chief in #camping on freenode.net announces checkins to Camping, Park Place and MouseHole. * http://code.whytheluckystiff.net/mouseHole.xml * http://code.whytheluckystiff.net/svn/mouseHole/timeline _why From why at hobix.com Wed May 17 18:09:41 2006 From: why at hobix.com (why the lucky stiff) Date: Wed, 17 May 2006 16:09:41 -0600 Subject: + mh2 doorblocks -- just checked in Message-ID: <446B9F25.4010602@hobix.com> I'm going to just explain MouseHole trunk features as they roll in. I'll probably dig a bit deeper into some of these with screenshots on RedHanded, but I just want to keep some notes. == Doorblocks: Small apps for the doorway MouseHole 1 listed all of your scripts on the doorway and you could turn them on and off, configure them from there. This has moved to the Apps page in MouseHole 2. In MouseHole 2, the doorway functions as more of a desktop for your apps. So, for example, if you have an app that's a wiki. If you use this personal wiki much, it might be handy to have an empty box on your doorway for entering new wiki pages. Or you may want to have the recent changes there. Or the markup from some important page in the wiki. Following this example, here's a doorblock for showing Recent Changes to Tepee. This code gets added to tepee.rb (right under the Camping.goes line.) This is unstable code, so it all may change: module Tepee::MouseHole class RecentChanges def get pages = Tepee::Models::Page.find(:all, :include => :versions, :order => 'tepee_page_versions.updated_at DESC', :limit => 10) div { ul { pages.each { |page| li page.title } } } end end end Classes contained in the App::MouseHole module are your "doorblocks." They function as normal Camping-style controller classes (they receive @env, @cookies, @input, etc.) The content generated by the controller is shown on the doorway. _why From why at hobix.com Thu May 18 12:52:24 2006 From: why at hobix.com (why the lucky stiff) Date: Thu, 18 May 2006 10:52:24 -0600 Subject: + mh2 feeds In-Reply-To: <446B9F25.4010602@hobix.com> References: <446B9F25.4010602@hobix.com> Message-ID: <446CA648.9000008@hobix.com> The new MouseHole 2 feeds are checked in. If you were getting errors about a missing 'lib/mouseHole/helpers.rb' last night, that's thankfully repaired. MouseHole feeds are designed for use with Firefox's Live bookmark. You bookmark the feed and firefox creates a submenu listing all your MouseHole apps. You should see an orange icon in the address bar when you visit the doorway (http://mh/ if you have MouseHole set as proxy.) Click the orange icon and you'll have two options: App Feed or the App (Mounts Only) feed. You can also find links to the feeds at the bottom of the 'apps' page. The first feed is the Apps Feed, which starts with a link to the doorway. And then lists your apps alphabetically with appropriate links to both configuration pages and mounts (if available.) The second feed is the Apps (Mounts Only) feed, which lists only the doorway and app mounts. I guess I figured that the configuration pages are probably hit less often. _why From why at hobix.com Thu May 18 21:41:11 2006 From: why at hobix.com (why the lucky stiff) Date: Thu, 18 May 2006 19:41:11 -0600 Subject: Bug report thingy for mouseHole 70! Oh no! In-Reply-To: <5FEFD3F7-5192-48A1-A63C-5531946ED161@gmail.com> References: <5FEFD3F7-5192-48A1-A63C-5531946ED161@gmail.com> Message-ID: <446D2237.8040904@hobix.com> Leon Spencer wrote: > Oh no! I think my weather widget is making mouseHole 70 sad :( > > ERROR: bad URI(is not URI?): > http://wu.apple.com/adcbin/apple/Apple_Weather_Data.asp?zipcode=OCN|AU|NSW|SYDNEY| > > /opt/local/lib/ruby/1.8/uri/common.rb:432:in `split' > /opt/local/lib/ruby/1.8/uri/common.rb:481:in `parse' > /opt/local/lib/ruby/1.8/uri/common.rb:604:in `URI' > /Users/chaos/mouseHole/lib/mouseHole/page.rb:19:in `initialize' > /Users/chaos/mouseHole/lib/mouseHole/proxyhandler.rb:95:in `process' Thankyou, Leon! This is fixed in changeset 71: http://code.whytheluckystiff.net/mouseHole/changeset/71. _why From speechexpert at sbcglobal.net Fri May 19 13:22:07 2006 From: speechexpert at sbcglobal.net (John Brookes) Date: Fri, 19 May 2006 10:22:07 -0700 Subject: Bug report thingy for mouseHole 70! Oh no! References: <5FEFD3F7-5192-48A1-A63C-5531946ED161@gmail.com> <446D2237.8040904@hobix.com> Message-ID: <02ad01c67b68$c196ab50$6401a8c0@LAP> "why the lucky stiff" - is that an ad for viagra? ----- Original Message ----- From: "why the lucky stiff" To: "Leon Spencer" Cc: Sent: Thursday, May 18, 2006 6:41 PM Subject: Re: Bug report thingy for mouseHole 70! Oh no! > Leon Spencer wrote: >> Oh no! I think my weather widget is making mouseHole 70 sad :( >> >> ERROR: bad URI(is not URI?): >> http://wu.apple.com/adcbin/apple/Apple_Weather_Data.asp?zipcode=OCN|AU|NSW|SYDNEY| >> >> /opt/local/lib/ruby/1.8/uri/common.rb:432:in `split' >> /opt/local/lib/ruby/1.8/uri/common.rb:481:in `parse' >> /opt/local/lib/ruby/1.8/uri/common.rb:604:in `URI' >> /Users/chaos/mouseHole/lib/mouseHole/page.rb:19:in `initialize' >> /Users/chaos/mouseHole/lib/mouseHole/proxyhandler.rb:95:in `process' > Thankyou, Leon! This is fixed in changeset 71: > http://code.whytheluckystiff.net/mouseHole/changeset/71. > > _why > _______________________________________________ > Mousehole-scripters mailing list > Mousehole-scripters at rubyforge.org > http://rubyforge.org/mailman/listinfo/mousehole-scripters > > __________ NOD32 1.1547 (20060518) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com > >