<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Discussion on Craigslist image preview | Userscripts.org</title>
    <link>http://userscripts.org/scripts/show/6155</link>
    <description>Recent comments on userscript: Craigslist image preview</description>
    <language>en-us</language>
    <ttl>60</ttl>
    <item>
      <title>Images all load before able to start another search, replied by Jeffrey Palm</title>
      <description>&lt;p&gt;Talk to Mozilla, this is a browser issue.&lt;/p&gt;</description>
      <pubDate>Wed, 06 Jan 2010 15:03:52 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:42672:205171</guid>
      <author>Jeffrey Palm</author>
      <link>http://userscripts.org/posts/205171</link>
    </item>
    <item>
      <title>Images all load before able to start another search, replied by Cereal</title>
      <description>&lt;p&gt;I love this script, but I've noticed an annoying behavior in it. When you either click on a category or attempt to begin another search, at which time images begin loading on the page, the browser/script wants to allow all of the images to load before you can start another search. In other words, if you search and images are still loading then you change your mind and want to immediately search again, you have to wait for the whole page and all preview images to load before it will begin the next search. I'd love to see a modification of this behavior so beginning a new search will interrupt the current process and begin the next, without waiting for the entire 100 posts with images to load. &lt;/p&gt;

&lt;p&gt;Thanks for the awesome script!&lt;/p&gt;</description>
      <pubDate>Sun, 03 Jan 2010 01:00:23 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:42672:204135</guid>
      <author>Cereal</author>
      <link>http://userscripts.org/posts/204135</link>
    </item>
    <item>
      <title>bug fix and my personal modifications, replied by Jeffrey Palm</title>
      <description>&lt;p&gt;New version is uploaded here and on my site.  Thanks for the feedback, hope it's helpful for you.&lt;/p&gt;</description>
      <pubDate>Sat, 02 Jan 2010 02:11:25 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:42564:203927</guid>
      <author>Jeffrey Palm</author>
      <link>http://userscripts.org/posts/203927</link>
    </item>
    <item>
      <title>bug fix and my personal modifications, replied by slwf</title>
      <description>&lt;p&gt;You missed a place when adding the regex pattern. You need to also add it to line 89. 
&lt;br /&gt;s = s.replace(/img [^&gt;]*src=/g,&quot;&quot;);&lt;/p&gt;

&lt;p&gt;I also added the space between the img and the [^ on line 73.
&lt;br /&gt;if (m = details.responseText.match(/img [^&gt;]*src=\&quot;([^\&quot;]+)\&quot;/gi)) {&lt;/p&gt;</description>
      <pubDate>Fri, 01 Jan 2010 19:23:32 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:42564:203885</guid>
      <author>slwf</author>
      <link>http://userscripts.org/posts/203885</link>
    </item>
    <item>
      <title>bug fix and my personal modifications, replied by Jeffrey Palm</title>
      <description>&lt;p&gt;Thanks a lot, I've uploaded the new version to userscripts and to my site: &lt;a href=&quot;http://jeffpalm.com/craigslist/...thanks&quot;&gt;http://jeffpalm.com/craigslist/...thanks&lt;/a&gt;, again.&lt;/p&gt;</description>
      <pubDate>Fri, 01 Jan 2010 14:36:35 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:42564:203835</guid>
      <author>Jeffrey Palm</author>
      <link>http://userscripts.org/posts/203835</link>
    </item>
    <item>
      <title>bug fix and my personal modifications, replied by dado</title>
      <description>&lt;p&gt;This is my fix for when the image has extra attributes (i.e. border) between &quot;img&quot; and &quot;src&quot;.
&lt;br /&gt;Just modify the pattern and add &quot;[^&gt;]*&quot; before &quot;src&quot;,
&lt;br /&gt;e.g. /img [^&gt;]*src=\&quot;([^\&quot;]+)\&quot;/gi
&lt;br /&gt;The reason I didn't use .* is that some posts have multiple images on the same line and I don't think javascript supports non greedy matches.&lt;/p&gt;

&lt;p&gt;I've also added a few modifications to suit my needs.
&lt;br /&gt;I'm looking for rentals an San Francisco's North Bay. There are a few towns I'm sure I don't want to move to so I've added a list of ignoredTowns and the code yanks those out of the page.&lt;/p&gt;

&lt;p&gt;Also, some realtors include logos and other crap. I'm filtering those images out too, but I need to add to that list every now and then (i.e. requires some maintenance)&lt;/p&gt;

&lt;p&gt;The last thing I'm still working on is to filter out over posting by some realtors.
&lt;br /&gt;The only consistent commonality between the posts are the images, so I'm storing their md5 and removing subsequent matches.&lt;/p&gt;

&lt;p&gt;All this is hardcoded. I might release my fixes if/when I expose all that in the UI.
&lt;br /&gt;That is, if there's any interest.&lt;/p&gt;</description>
      <pubDate>Thu, 31 Dec 2009 23:44:41 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:42564:203754</guid>
      <author>dado</author>
      <link>http://userscripts.org/posts/203754</link>
    </item>
    <item>
      <title>Archived Comments, replied by Lawk Salih</title>
      <description>&lt;p&gt;Neat script. HOWEVER, when an ad uses postlets, it returns terrible results.  &lt;/p&gt;

&lt;p&gt;Check out &lt;a href=&quot;http://washingtondc.craigslist.org/rea/&quot;&gt;http://washingtondc.craigslist.org/rea/&lt;/a&gt; for confirmation when you have this script installed.&lt;/p&gt;</description>
      <pubDate>Fri, 12 Sep 2008 17:37:45 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35734</guid>
      <author>Lawk Salih</author>
      <link>http://userscripts.org/posts/35734</link>
    </item>
    <item>
      <title>Archived Comments, replied by Kite</title>
      <description>&lt;p&gt;Since Jeffrey doesn't seem to be updating his wonderful script, I posted my bug fixes &amp;amp; improvements, plus the Canadian fix (thanks Rich!) as a new script, &quot;Craigslist image preview 2&quot;. It now filters out tiny images, and enlarges the thumbnails on mouseover. &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://userscripts.org/scripts/show/24089&quot;&gt;http://userscripts.org/scripts/show/24089&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 18 Mar 2008 21:54:51 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35735</guid>
      <author>Kite</author>
      <link>http://userscripts.org/posts/35735</link>
    </item>
    <item>
      <title>Archived Comments, replied by macm</title>
      <description>&lt;p&gt;Kind of the same thing, but works at &lt;a href=&quot;http://www.craigstoolbox.com&quot;&gt;http://www.craigstoolbox.com&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 17 Mar 2008 14:54:56 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35736</guid>
      <author>macm</author>
      <link>http://userscripts.org/posts/35736</link>
    </item>
    <item>
      <title>Archived Comments, replied by Profmuggs</title>
      <description>&lt;p&gt;whoops, that should have been:&lt;/p&gt;

&lt;p&gt;replace line 78...
&lt;br /&gt;&lt;code&gt;for (j=0; j&amp;lt;m&gt;&lt;/p&gt;

&lt;p&gt;with...
&lt;br /&gt;&lt;code&gt;for (j=0; j&amp;lt;5&gt;&lt;/code&gt;&lt;/code&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 26 Feb 2008 19:25:00 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35737</guid>
      <author>Profmuggs</author>
      <link>http://userscripts.org/posts/35737</link>
    </item>
    <item>
      <title>Archived Comments, replied by Profmuggs</title>
      <description>&lt;p&gt;Lately, the only listings that have more than 4 images are the mass postings by used car dealers and real estate agents. I find these listings annoying so I limited the number of pictures my browser displays to 6. This way I can tell the mass postings apart from the casual users who are content with the 4 image fields supplied by Craigslist. To do this I replaced line 78....&lt;/p&gt;

&lt;p&gt;for (j=0; j&amp;lt;m&gt;&lt;/p&gt;

&lt;p&gt;with...&lt;/p&gt;

&lt;p&gt;for (j=0; j&amp;lt;6&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 26 Feb 2008 19:21:51 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35738</guid>
      <author>Profmuggs</author>
      <link>http://userscripts.org/posts/35738</link>
    </item>
    <item>
      <title>Archived Comments, replied by sqladmin</title>
      <description>&lt;p&gt;A W E S O M E !!!!!&lt;/p&gt;

&lt;p&gt;this script rocks!  craigslist is sooo much
&lt;br /&gt;better now.&lt;/p&gt;</description>
      <pubDate>Tue, 19 Feb 2008 19:13:16 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35739</guid>
      <author>sqladmin</author>
      <link>http://userscripts.org/posts/35739</link>
    </item>
    <item>
      <title>Archived Comments, replied by Kite</title>
      <description>&lt;p&gt;Bug fix #1 (missing thumbnails):
&lt;br /&gt;the image preview won't appear if the original img tag in the ad has any attribute (style, border, etc.) before the source attribute. This can be fixed like so:&lt;/p&gt;

&lt;p&gt;line 71, change (/img src=\&quot;([^\&quot;]+)\&quot;/gi)) to 
&lt;br /&gt;(/&lt;img&gt;]+)&gt;/gi))&lt;/p&gt;

&lt;p&gt;line 84 &amp;amp; 85 change to: &lt;code&gt;
&lt;br /&gt;          s = s.split('src=&quot;')[1];
&lt;br /&gt;          s = s.split('&quot;')[0];
&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Bug fix #2 (small pics blown up):
&lt;br /&gt;Small images won't be enlarged if we change width &amp;amp; height to maxWidth &amp;amp; maxHeight in lines 105, 107, 166 &amp;amp; 168.&lt;/p&gt;

&lt;p&gt;Improvement #1 (small-pics clutter):
&lt;br /&gt;To filter out small images, so that they don't even appear, add this code between lines 107-108:
&lt;br /&gt;&lt;code&gt;
&lt;br /&gt;img.addEventListener(&quot;load&quot;, function() {
&lt;br /&gt;                        if (this.height &amp;lt; size) {
&lt;br /&gt;                          this.parentNode.parentNode.removeChild(this.parentNode);
&lt;br /&gt;                        } 
&lt;br /&gt;                      },true);
&lt;br /&gt;&lt;/code&gt;
&lt;br /&gt;NOTE: improvement #1 will not work without bug fix #2!&lt;/p&gt;

&lt;p&gt;Improvement #2 (enlarge thumbnail on mouseover):
&lt;br /&gt;right after the last event handler, add this code:
&lt;br /&gt;&lt;code&gt;
&lt;br /&gt;img.addEventListener(&quot;mouseover&quot;, function() {
&lt;br /&gt;                       this.style.maxHeight = 100 * size + &quot;px&quot;;
&lt;br /&gt;                       if (!keepAspectRatio) {
&lt;br /&gt;                         this.style.maxWidth = 100 * size + &quot;px&quot;;
&lt;br /&gt;                       } 
&lt;br /&gt;                     },true);
&lt;br /&gt;img.addEventListener(&quot;mouseout&quot;, function() {
&lt;br /&gt;                       this.style.maxHeight = size + &quot;px&quot;;
&lt;br /&gt;                       if (!keepAspectRatio) {
&lt;br /&gt;                         this.style.maxWidth = size + &quot;px&quot;;
&lt;br /&gt;                       } 
&lt;br /&gt;                    },true);&lt;/p&gt;

&lt;p&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;(100 is an arbitrary large number that sets the size ceiling high enough to not squash any pics.)&lt;/p&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:49:38 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35740</guid>
      <author>Kite</author>
      <link>http://userscripts.org/posts/35740</link>
    </item>
    <item>
      <title>Archived Comments, replied by Rich Lafferty</title>
      <description>&lt;p&gt;Canadians: The script has &quot;.org&quot; hardcoded, that's why it doesn't work on *.craigslist.ca. It's not enough to just add *.craigslist.ca to the list of sites it's applied to. You need to edit the script itself.&lt;/p&gt;

&lt;p&gt;Currently line 180 in the showImages() function reads
&lt;br /&gt;&lt;pre&gt;
    if (link.href &amp;amp;&amp;amp; link.href.match(/.*craigslist.org.*\/\d+\.html$/)) {
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;Change that to read
&lt;br /&gt;&lt;pre&gt;
     if (link.href &amp;amp;&amp;amp; link.href.match(/.*craigslist.*\/\d+\.html$/)) {
&lt;/pre&gt;
&lt;br /&gt;You might as well edit the @include on line 5 while you're in there. &lt;/p&gt;

&lt;p&gt;I suppose the same applies for other ccTLD craigslists, if those exist.&lt;/p&gt;</description>
      <pubDate>Sun, 30 Dec 2007 01:29:51 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35741</guid>
      <author>Rich Lafferty</author>
      <link>http://userscripts.org/posts/35741</link>
    </item>
    <item>
      <title>Archived Comments, replied by tobias_funke</title>
      <description>&lt;p&gt;Great script, thanmks.  Two things:&lt;/p&gt;

&lt;p&gt;How, exactly, does one &quot;resize the image previews&quot;?&lt;/p&gt;

&lt;p&gt;Also, I agree with the previous commenter.  The enlarged small images ought to be fixed.&lt;/p&gt;</description>
      <pubDate>Sat, 29 Dec 2007 03:24:44 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35742</guid>
      <author>tobias_funke</author>
      <link>http://userscripts.org/posts/35742</link>
    </item>
    <item>
      <title>Archived Comments, replied by Kite</title>
      <description>&lt;p&gt;Works great! One little quibble, some people put tiny images in their ads, which get blown up huge &amp;amp; get in the way. This problem can be fixed by adding an if statement around the resizing code, like so:&lt;/p&gt;

&lt;p&gt;          if (img.height &gt; size) {
&lt;br /&gt;              if (!keepAspectRatio) {
&lt;br /&gt;                img.style.width = size + &quot;px&quot;;
&lt;br /&gt;              }
&lt;br /&gt;              img.style.height = size + &quot;px&quot;;
&lt;br /&gt;          }&lt;/p&gt;

&lt;p&gt;(First and last lines are new code). It needs to be done in both newFunction and changeSizes. I tested it, seeemed to work, but was a little buggy in the changeSizes function. I'm new to javascript, so I probably missed something...&lt;/p&gt;</description>
      <pubDate>Fri, 21 Dec 2007 02:23:53 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35743</guid>
      <author>Kite</author>
      <link>http://userscripts.org/posts/35743</link>
    </item>
    <item>
      <title>Archived Comments, replied by Stoney</title>
      <description>&lt;p&gt;Just wondering if it is still working for Craigslist Canadian postings. I can get it too work for all of the American cities, but when I try it with Canadian cities, it no longer works.
&lt;br /&gt;IE.  &lt;a href=&quot;http://toronto.craigslist.ca/sys/&quot;&gt;http://toronto.craigslist.ca/sys/&lt;/a&gt;   no pictures at all. If you don't mind could someone click on the link and let me know if the images show up. Thanks Stoney&lt;/p&gt;</description>
      <pubDate>Thu, 08 Nov 2007 23:53:18 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35744</guid>
      <author>Stoney</author>
      <link>http://userscripts.org/posts/35744</link>
    </item>
    <item>
      <title>Archived Comments, replied by nastajus</title>
      <description>&lt;p&gt;works perfectly in my single page test at &lt;a href=&quot;http://toronto.craigslist.org/search/sss?query=hex&quot;&gt;http://toronto.craigslist.org/search/sss?query=hex&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 18 Oct 2007 04:47:48 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35745</guid>
      <author>nastajus</author>
      <link>http://userscripts.org/posts/35745</link>
    </item>
    <item>
      <title>Archived Comments, replied by Martin Jessen</title>
      <description>&lt;p&gt;This works fine except for when looking at cars and trucks, the first image is a blank picture!
&lt;br /&gt;See example:
&lt;br /&gt;&lt;a href=&quot;http://silenceisdefeat.org/~deltron/craigslist.png&quot;&gt;http://silenceisdefeat.org/~deltron/craigslist.png&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 18 Oct 2007 03:25:05 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35746</guid>
      <author>Martin Jessen</author>
      <link>http://userscripts.org/posts/35746</link>
    </item>
    <item>
      <title>Archived Comments, replied by Alan Hogan</title>
      <description>&lt;p&gt;Doesn't work in Opera... Would love it if you could make it work in Opera?&lt;/p&gt;</description>
      <pubDate>Sat, 09 Jun 2007 19:27:46 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35747</guid>
      <author>Alan Hogan</author>
      <link>http://userscripts.org/posts/35747</link>
    </item>
    <item>
      <title>Archived Comments, replied by fan</title>
      <description>&lt;p&gt;This is a great script!
&lt;br /&gt;Would there be any way to have the images show in real size on mouse over?&lt;/p&gt;</description>
      <pubDate>Sat, 09 Jun 2007 17:44:15 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35748</guid>
      <author>fan</author>
      <link>http://userscripts.org/posts/35748</link>
    </item>
    <item>
      <title>Archived Comments, replied by Tetsuya Saito</title>
      <description>&lt;p&gt;Works! You just need to wait a little as it retrieves them.&lt;/p&gt;</description>
      <pubDate>Tue, 16 Jan 2007 05:33:07 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35749</guid>
      <author>Tetsuya Saito</author>
      <link>http://userscripts.org/posts/35749</link>
    </item>
    <item>
      <title>Archived Comments, replied by Patrick 3</title>
      <description>&lt;p&gt;This script would be great... if it weren't so handicapped by only working on real estate pages.  I don't understand how/why that is, I browse for furniture all the time, but houses only once in a while.&lt;/p&gt;</description>
      <pubDate>Sat, 25 Nov 2006 17:20:53 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35750</guid>
      <author>Patrick 3</author>
      <link>http://userscripts.org/posts/35750</link>
    </item>
    <item>
      <title>Archived Comments, replied by NoWai</title>
      <description>&lt;p&gt;this doesnt work.&lt;/p&gt;</description>
      <pubDate>Tue, 14 Nov 2006 07:17:35 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35751</guid>
      <author>NoWai</author>
      <link>http://userscripts.org/posts/35751</link>
    </item>
    <item>
      <title>Archived Comments, replied by Swakky</title>
      <description>&lt;p&gt;It worked perfectly for me, thanks!&lt;/p&gt;</description>
      <pubDate>Wed, 01 Nov 2006 06:08:49 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:12482:35752</guid>
      <author>Swakky</author>
      <link>http://userscripts.org/posts/35752</link>
    </item>
  </channel>
</rss>
