From lwu.two at gmail.com Thu Feb 1 18:05:52 2007 From: lwu.two at gmail.com (Leslie Wu) Date: Thu, 1 Feb 2007 15:05:52 -0800 Subject: on blocking Message-ID: <78ec96990702011505pf5b52fcw3256f2d56d266ae9@mail.gmail.com> I usually don't go out of my way to block ads, but I was searching for "expand_path" on ruby-doc search (powered by Rollyo), and got ad results that were not only inappropriate but visually annoying. (I wrote to JBritt about this just now.) Platypus (http://platypus.mozdev.org/) and Ad Block software would probably let you get rid of this, but I thought I'd share how I just did it in MouseHole 2.0 Beta. First, I used Firebug (http://www.getfirebug.com/) on Firefox to figure out what to weed out. Firefox lets you have an iconic pair of glasses on your toolbar, which correspond to "inspect". Using "inspect", I found out the offending elements were "dl" tags which had the 'onclick' attribute. This led to the following code: ### class Block < MouseHole::App title 'Block' description "block annoying things" version '1.0' + url("http://rollyo.com/*") + url("http://www.rollyo.com/*") def rewrite(page) document.search('dl').each { |node| node.inner_html = nil if node['onclick'] } end end ### One Hpricot 0.5 gotcha seems to be that if you call any Enumerable# methods, you get an Array rather than an "Hpricot::Elements (< Array)" back, which is a little confusing if you don't know how Hpricot::Elements are actually implemented. I suppose the quick hack is to define Elements#select and so on, but there's probably a nicer way to do such things... ~L -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mousehole-scripters/attachments/20070201/65c55f9d/attachment.html From lwu.two at gmail.com Sun Feb 4 19:59:56 2007 From: lwu.two at gmail.com (Leslie Wu) Date: Sun, 4 Feb 2007 16:59:56 -0800 Subject: mousehole Net::HTTP(S)::Proxy'ing Message-ID: <78ec96990702041659o293520f9r5528d466e3027e37@mail.gmail.com> Hey, I've been trying to get proxylike to proxy https sites (ignoring security concerns for the moment). Set as a Firefox proxy, mH2 seems to support proxying https:// sites such as https://login.yahoo.com, which means I can log into Yahoo! successfully. However, as of the moment, trying to use proxylike to access http://127.0.0.1:3704/https://login.yahoo.com/ from Firefox (no proxy set there) doesn't yet work -- 404 on the mH2 console. I just added a unit test for a simpler case, just using Net::HTTP::Proxy to get_response from https://javacc.dev.java.net/ -- a non-random https site with high PageRank. This test currently fails, and I'll try to work it through, but to make sure my understanding is correct, I ran this script -- http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/23379 -- against http://127.0.0.1:3704 and http://127.0.0.1:8888, mH2 and Charles respectively. The former fails, but the latter succeeds. [Charles is a Java-based Web Debugging proxy (http://www.xk72.com/charles/)] This suggests to me that: * Net::HTTP::Proxy'ing a HTTPS site works (with Charles, a 3rd party proxy) * mH2 can proxy HTTPS if accessed from Firefox but * mH2 + HTTPS + Net::HTTP::Proxy doesn't work yet. Phew. As an aside, now that you can get the Firebug source through svn, tools to integrate mH2+Firebug might be mighty sweet. ~L -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mousehole-scripters/attachments/20070204/175bd3c8/attachment.html From lwu.two at gmail.com Sun Feb 4 21:15:30 2007 From: lwu.two at gmail.com (Leslie Wu) Date: Sun, 4 Feb 2007 18:15:30 -0800 Subject: mousehole Net::HTTP(S)::Proxy'ing In-Reply-To: <78ec96990702041659o293520f9r5528d466e3027e37@mail.gmail.com> References: <78ec96990702041659o293520f9r5528d466e3027e37@mail.gmail.com> Message-ID: <78ec96990702041815k2a8ef0e4r747bcf548a71983e@mail.gmail.com> D'oh, it looks like I might have run into a Firefox 2 + SwitchProxy bug. I left "Use this proxy server for all protocols" clicked, and https wasn't getting passed through mouseHole (Mongrel) as it should have been. I click it off and on, and it passes through. Mongrel (and thus mH2 out of the box) doesn't support SSL, so I'll have to piece together some other workaround. ~L On 2/4/07, Leslie Wu wrote: > > Hey, > > I've been trying to get proxylike to proxy https sites (ignoring security > concerns for the moment). > > Set as a Firefox proxy, mH2 seems to support proxying https:// sites such > as https://login.yahoo.com, which means I can log into Yahoo! > successfully. > > However, as of the moment, trying to use proxylike to access http://127.0.0.1:3704/https://login.yahoo.com/ > from Firefox (no proxy set there) doesn't yet work -- 404 on the mH2 > console. > > I just added a unit test for a simpler case, just using Net::HTTP::Proxy > to get_response from https://javacc.dev.java.net/ -- a non-random https > site with high PageRank. > > This test currently fails, and I'll try to work it through, but to make > sure my understanding is correct, I ran this script -- > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/23379 -- > against http://127.0.0.1:3704 and http://127.0.0.1:8888, mH2 and Charles > respectively. > > The former fails, but the latter succeeds. > > [Charles is a Java-based Web Debugging proxy ( > http://www.xk72.com/charles/) ] > > This suggests to me that: > > * Net::HTTP::Proxy'ing a HTTPS site works (with Charles, a 3rd party > proxy) > * mH2 can proxy HTTPS if accessed from Firefox > > but > > * mH2 + HTTPS + Net::HTTP::Proxy doesn't work yet. > > Phew. > > As an aside, now that you can get the Firebug source through svn, tools to > integrate mH2+Firebug might be mighty sweet. > > ~L > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mousehole-scripters/attachments/20070204/d2a7d37e/attachment.html From infobox-news at gmx.net Mon Feb 5 03:26:06 2007 From: infobox-news at gmx.net (JS) Date: Mon, 05 Feb 2007 09:26:06 +0100 Subject: [Fwd: Re: xhtml and proxylike] Message-ID: <45C6EA1E.6000004@gmx.net> Hi why and list thanks for that, you?re right. i?ve didn?t installed the latest gem. my fault, i installed the gem without the source parameter ;) now it works, but there is another failure. inside mousehole you try to detect the content-type, right? in one place there must be an mistake, because firefox should interpret a xhtml strict site as text/html and not as text/xml but firefox doesn?t. when i check the header with curl --head http://www.designer-profile.de for example the content-type is set text/html but with curl --head http://localhost/http://www.designer-profile.de the content-type is missing and firefox intepret it as text/xml. the result is an xml parsing error, because the site is not valid. is there any chance to fetch the header and pass it through or is there another problem that i didn?t watch thx for all that. when i finished my work, i will post it here. it?s for my thesis josu why the lucky stiff schrieb: > On Tue, Jan 30, 2007 at 05:32:04PM +0100, JS wrote: > >> i?ve got a problem with proxylike and xhtml. >> i can?t get xhtml sites via the proxylike script. >> there must be an bug in hpricot or in mh2 >> >> all my classes an lib are the newest revision. >> >> if i do http://localhost/http://www.w3c.org >> >> my browser said: >> >> -----------------------------------------^ >> > > Check your Hpricot version again. This problem was resolved (I > believe) in Hpricot 0.4.99.[1] > > gem install hpricot --source http://code.whytheluckystiff.net > > It just came out in the last few days! > > _why > > [1] https://code.whytheluckystiff.net/hpricot/changeset/95 > > From mousehole at tcb.mailworks.org Wed Feb 21 06:47:06 2007 From: mousehole at tcb.mailworks.org (Timothy Brown) Date: Wed, 21 Feb 2007 06:47:06 -0500 Subject: mousehole 2 problems with junebug Message-ID: <881820AF-6EFB-42ED-AA59-2DEA9B35F672@tcb.mailworks.org> == Junebug::Models::CreateJunebug: migrated (0.0963s) ========================= -- create_table(:sessions, {:force=>true}) -> 0.0030s ** MouseHole running on 0.0.0.0:3704 Wed Feb 21 06:42:17 -0500 2007: ERROR: bad argument, String or IO only please. Any ideas? This is after I go to my mouseHole and click on the Junebug homepage. JuneBug 0.0.28 latest SVN. thanks, tim From lwu.two at gmail.com Tue Feb 27 13:49:53 2007 From: lwu.two at gmail.com (Leslie Wu) Date: Tue, 27 Feb 2007 10:49:53 -0800 Subject: mousehole 2 problems with junebug In-Reply-To: <881820AF-6EFB-42ED-AA59-2DEA9B35F672@tcb.mailworks.org> References: <881820AF-6EFB-42ED-AA59-2DEA9B35F672@tcb.mailworks.org> Message-ID: <78ec96990702271049r72c679b7v448889f60d7d247e@mail.gmail.com> Hi Tim, I ran into this while doing certain operations with the tepee. "bad argument, String or IO only please." is Hpricot speaking, although that's not immediately obvious. I changed hpricot_scan and mouseHole app.rb to catch this exception, so Junebug mostly works now. You'll need to patch lines like redirect("/login?return_to=#{CGI::escape(@env['REQUEST_URI'])}") in Junebug, as this redirects users to "/junebug/junebug/Home_Page/1/edit", which isn't quite right (mouseHole makes apps live under their own subdirectory, but Junebug isn't quite ready to move in.) Happy mouseHole camping! ~L On 2/21/07, Timothy Brown wrote: > > == Junebug::Models::CreateJunebug: migrated (0.0963s) > ========================= > > -- create_table(:sessions, {:force=>true}) > -> 0.0030s > ** MouseHole running on 0.0.0.0:3704 > Wed Feb 21 06:42:17 -0500 2007: ERROR: bad argument, String or IO > only please. > > Any ideas? This is after I go to my mouseHole and click on the > Junebug homepage. > JuneBug 0.0.28 > > latest SVN. > > thanks, > tim > > _______________________________________________ > Mousehole-scripters mailing list > Mousehole-scripters at rubyforge.org > http://rubyforge.org/mailman/listinfo/mousehole-scripters > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mousehole-scripters/attachments/20070227/76db2d73/attachment-0001.html