If I comment out the first instance of 'list=(page/"div..." I'm able to get the script to load properly. As is, note that mouseHole will complain on the command-line that the script is broken (and also on the mouseHole apps page).
<br><br>~L<br><br><div><span class="gmail_quote">On 4/17/07, <b class="gmail_sendername">Josh Icuss</b> <<a href="mailto:jicuss@gmail.com">jicuss@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Sure. This is what I was working on for IFilm. Im looking to define
classes for each object to make it easier to work with and later store in a DB. Ive noticed that
Mousehole now supports SQLite databases. I like the direction your
taking the project. One thing I like about Scrapi is the built in class definitions.<br>
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>
require 'tidy'<br>
require 'scrapi'<br>
<br>
<br>
list=(page/"div.similarlist"/'div.related_meta_data')<br>
<br>
related_media = Scraper.define do<br>
process "a.title_link", :description=>:text, :url=>"@href"<br>
process "p.stats", :stats=>:text<br>
result :description, :url, :stats<br>
end<br>
<br>
class IFilm < MouseHole::App<br>
title "IFilm Ad remover"<br>
namespace ''<br>
description 'removes ifilm ads'<br>
version "0.1"<br>
+ url("http://*.ifilm.com/*")<br>
# + url("<a href="http://www.ifilm.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.ifilm.com/</a>")<br>
<br>
def rewrite(page)<br>
(document/"#HEADERAD").remove<br>
(document/"div.ad-rectangle").inner_html="funtimes"<br>
similar_videos=(document/"div.similar_videos_div")<br>
(document/"div[@id='SUPPLEMENT']").inner_html=similar_videos<br>
(document/"div[@id='comment_box']").remove<br>
(document/"div[@id='MYIFILM_BUMP']").remove<br>
(document/"div[@id='FOOTER']").remove<br>
(document/"h3[@id='UPLOAD']").remove<br>
(document/"div[@id='HEADER']").remove<br>
(document/"div[@id='TASKBAR']").remove<br>
list=(document/"div.similarlist"/'div.related_meta_data')<br>
media_urls=list.collect{|x| related_media.scrape(x.inner_html).url}<br>
<br>
string="<div id='nu'>"<br>
media_urls.each do |x|<br>
string << "<p>" << x << "</p>"<br>
end<br>
string << "</div>"<br>
(document/"div[@id='SUPPLEMENT']").inner_html=string<br>
<br>
<br>
end<br>
end<br>
<br>
<br>
<br>
<br>
<br><br><div><span class="gmail_quote">On 4/14/07, <b class="gmail_sendername">Leslie Wu</b> <<a href="mailto:lwu.two@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">lwu.two@gmail.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ah, you posted this to mousehole-scripters.<br><br>Do you have a sample where this breaks?<br><span><br>~L<br><br></span><div><span><span class="gmail_quote">On 4/11/07, <b class="gmail_sendername">Josh Icuss
</b> <<a href="mailto:jicuss@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
jicuss@gmail.com</a>> wrote:</span></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><span>Im realy digging the new syntax. Hpricot is a well developed choice. Having trouble loading the Scrapi gem. any known issues?
<br>require 'tidy' or require 'scrapi' causes the script not to load. Also could anyone provide a quick insert_before example?
<br>
<br></span><span>_______________________________________________<br>Mousehole-scripters mailing list<br><a href="mailto:Mousehole-scripters@rubyforge.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Mousehole-scripters@rubyforge.org
</a><br><a href="http://rubyforge.org/mailman/listinfo/mousehole-scripters" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://rubyforge.org/mailman/listinfo/mousehole-scripters</a><br></span></blockquote>
</div><br>
</blockquote></div><br><br>
<br>_______________________________________________<br>Mousehole-scripters mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Mousehole-scripters@rubyforge.org">Mousehole-scripters@rubyforge.org
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://rubyforge.org/mailman/listinfo/mousehole-scripters" target="_blank">http://rubyforge.org/mailman/listinfo/mousehole-scripters</a><br></blockquote>
</div><br>