<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Discussions on scripts by Johan Sundstr&#246;m | Userscripts.org</title>
    <description>Recent posts on all scripts by Johan Sundstr&#246;m at userscripts.org</description>
    <link>http://userscripts.org/users/326/scripts</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <item>
      <title>Change log, replied by Johan Sundstr&#246;m</title>
      <description>&lt;p&gt;Fixed the itemdb and usable handling code I broke.&lt;/p&gt;</description>
      <pubDate>Sun, 26 Jul 2009 08:33:31 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:31517:150862</guid>
      <author>Johan Sundstr&#246;m</author>
      <link>http://userscripts.org/posts/150862</link>
    </item>
    <item>
      <title>Change log, replied by Johan Sundstr&#246;m</title>
      <description>&lt;p&gt;Developer-facing changes only, I think: now the code for each location (where a location is defined as &quot;the pathname of the file implementing it server side, minus / and suffix&quot;) has its code in a corresponding at_locationname() function. Code providing spoilers for same location is, similarly, placed in spoil_locationname(), which won't get called if spoilers are turned off.&lt;/p&gt;

&lt;p&gt;So: no need to read through the entire code to see where things happen any more; it's pretty much just the file header and the functions named after the current page, and whatever those invoke in turn. Lots of undeclared variables fixed, and improved readability here and there (I must say the original author has a very peculiar approach to whitespace distribution).&lt;/p&gt;

&lt;p&gt;Try running &lt;code&gt;eval(mr.script.call(this))&lt;/code&gt; from your Firebug console to get all the script's global variables and functions from whichever frame loaded most recently, if you want to do some live debugging; it's kind of nice.&lt;/p&gt;</description>
      <pubDate>Sun, 26 Jul 2009 07:15:19 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:31517:150851</guid>
      <author>Johan Sundstr&#246;m</author>
      <link>http://userscripts.org/posts/150851</link>
    </item>
    <item>
      <title>Change log, replied by Johan Sundstr&#246;m</title>
      <description>&lt;p&gt;Fixed the Full Mode stats/level/adventure count parsing code, which seemed to have rotted.&lt;/p&gt;</description>
      <pubDate>Sat, 25 Jul 2009 20:52:41 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:31517:150687</guid>
      <author>Johan Sundstr&#246;m</author>
      <link>http://userscripts.org/posts/150687</link>
    </item>
    <item>
      <title>Change log, replied by Johan Sundstr&#246;m</title>
      <description>&lt;p&gt;Halved the storage requirements for the item database. This should decrease the burden paid in extra long firefox startup and shutdown times this script carries, though it's still not pretty.&lt;/p&gt;

&lt;p&gt;Made the script decode its script database once per session, instead of every single time it's needed. This should speed things up a bit, in-game.&lt;/p&gt;

&lt;p&gt;Firebug enabled browsers will see the some Mr. Script time penalties in the Firebug console. I might remove those again if they bother people.&lt;/p&gt;

&lt;p&gt;Did some refactoring to make the code less bulky.&lt;/p&gt;</description>
      <pubDate>Sat, 25 Jul 2009 20:50:29 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:31517:150685</guid>
      <author>Johan Sundstr&#246;m</author>
      <link>http://userscripts.org/posts/150685</link>
    </item>
    <item>
      <title>Calls Home, replied by jellybeans</title>
      <description>&lt;p&gt;This script calls home via background image. Could potentially even get the Referer url.  Every site that has redirection urls might be logged by the author.  I'm not claiming he is doing this he just could be...&lt;/p&gt;

&lt;p&gt;line 83:  var bg = '&lt;a href=&quot;http://www.lysator.liu.se/~jhs/gfx/bottom-left.png'&quot;&gt;http://www.lysator.liu.se/~jhs/gfx/bottom-left....&lt;/a&gt;;&lt;/p&gt;

&lt;p&gt;To fix: just remove the line or replace it with a local image file...&lt;/p&gt;

&lt;p&gt;Otherwise i love the script, just noticed the call home feature while editing it because it wasn't working on dA.&lt;/p&gt;</description>
      <pubDate>Fri, 24 Jul 2009 20:50:40 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:31439:150258</guid>
      <author>jellybeans</author>
      <link>http://userscripts.org/posts/150258</link>
    </item>
    <item>
      <title>I like it, nice idea., replied by Derek Wood</title>
      <description>&lt;p&gt;It's a nice little additional quick-reference tool to see on profile pages. I hope you don't end up having to update it too maddeningly often, given that OKC never seems to stick with a given design for more than a few weeks. :p&lt;/p&gt;

&lt;p&gt;Anyway, nice little feature - thanks for coming up with it.&lt;/p&gt;</description>
      <pubDate>Wed, 01 Jul 2009 21:03:31 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:29958:140923</guid>
      <author>Derek Wood</author>
      <link>http://userscripts.org/posts/140923</link>
    </item>
    <item>
      <title>Support for arrow scrolling, replied by Johan Sundstr&#246;m</title>
      <description>&lt;p&gt;Your suggested feature sounds like a new script. This script does something when you click a link. Clicking that link tells the script where you want to scroll to in the document. A tap at up, down, left or right moves a few pixels only, and would probably be mostly an annoying user experience smooth scrolling.&lt;/p&gt;

&lt;p&gt;(If that is the feature you are suggesting, it will not be implemented by me.)&lt;/p&gt;</description>
      <pubDate>Tue, 16 Jun 2009 00:55:15 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:28400:133762</guid>
      <author>Johan Sundstr&#246;m</author>
      <link>http://userscripts.org/posts/133762</link>
    </item>
    <item>
      <title>Support for arrow scrolling, replied by dob</title>
      <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;love the script.
&lt;br /&gt;Good work!
&lt;br /&gt;One suggestion, though:&lt;/p&gt;

&lt;p&gt;Enable support for the arrow keys (37,38,39,40)? Or just up/down?&lt;/p&gt;

&lt;p&gt;Would be a great replacement for several Firefox addons.&lt;/p&gt;</description>
      <pubDate>Mon, 08 Jun 2009 14:04:54 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:28400:130084</guid>
      <author>dob</author>
      <link>http://userscripts.org/posts/130084</link>
    </item>
    <item>
      <title>No longer working, replied by Mickeba</title>
      <description>&lt;p&gt;The script is broken as of May 27 2009.
&lt;br /&gt;Spraydate updated the site.&lt;/p&gt;

&lt;p&gt;An updated and working script would be great :)&lt;/p&gt;</description>
      <pubDate>Fri, 29 May 2009 13:31:43 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:27806:126986</guid>
      <author>Mickeba</author>
      <link>http://userscripts.org/posts/126986</link>
    </item>
    <item>
      <title>Bravo!, replied by Johan Sundstr&#246;m</title>
      <description>&lt;p&gt;Mon plaisir. :-)&lt;/p&gt;</description>
      <pubDate>Sun, 24 May 2009 18:31:41 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:25773:125348</guid>
      <author>Johan Sundstr&#246;m</author>
      <link>http://userscripts.org/posts/125348</link>
    </item>
    <item>
      <title>Script does not work anymore in Firefox 3.1 beta 3, replied by Johan Sundstr&#246;m</title>
      <description>&lt;p&gt;Try the script's upstream installation url &lt;a href=&quot;http://kronos-utils.notlong.com/&quot;&gt;http://kronos-utils.notlong.com/&lt;/a&gt; -- I don't push updates here very often, as I'm a lazy bum and the @resource and @require lines would have to become absolute urls rather than being local here on us.o, which I don't quite like.&lt;/p&gt;</description>
      <pubDate>Fri, 15 May 2009 22:38:35 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:23335:122001</guid>
      <author>Johan Sundstr&#246;m</author>
      <link>http://userscripts.org/posts/122001</link>
    </item>
    <item>
      <title>Script does not work anymore in Firefox 3.1 beta 3, replied by Drew Dupont</title>
      <description>&lt;p&gt;Any news on an update? Just won't run anymore.&lt;/p&gt;</description>
      <pubDate>Wed, 13 May 2009 00:14:25 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:23335:120739</guid>
      <author>Drew Dupont</author>
      <link>http://userscripts.org/posts/120739</link>
    </item>
    <item>
      <title>Bravo!, replied by decembre</title>
      <description>&lt;p&gt;voil&#224; un &quot;vieux&quot; (2005!) script bien utile...&lt;/p&gt;

&lt;p&gt;En ajoutant un petit coup d'Addblock Plus, alors l&#224;, c'est magique.&lt;/p&gt;

&lt;p&gt;J'aime pas les Bling-Blingueries! &lt;/p&gt;

&lt;p&gt;;-)Thank you et Merci au Blog Libellules de me l'avoir signal&#233;.&lt;/p&gt;</description>
      <pubDate>Wed, 29 Apr 2009 03:31:45 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:25773:115866</guid>
      <author>decembre</author>
      <link>http://userscripts.org/posts/115866</link>
    </item>
    <item>
      <title>LiURL.cn, replied by Johan Sundstr&#246;m</title>
      <description>&lt;p&gt;Since you are one of the nice redirection services that don't do anything weirder than returning a 302 redirect to the sought resource, there isn't even any need to use your custom API -- just a HTTP HEAD of &lt;a href=&quot;http://liurl.cn/0v8&quot;&gt;http://liurl.cn/0v8&lt;/a&gt; will get the sought address in the &lt;code&gt;location&lt;/code&gt; header, so it already works by default. Thanks for the shout-out though; I haven't tested more than fractions of these services myself or encountered links by them in the wild yet, so I haven't tagged more than a few as &quot;known to work&quot; so far.&lt;/p&gt;</description>
      <pubDate>Wed, 22 Apr 2009 04:21:35 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:25262:113550</guid>
      <author>Johan Sundstr&#246;m</author>
      <link>http://userscripts.org/posts/113550</link>
    </item>
    <item>
      <title>LiURL.cn, replied by lawrencesheed</title>
      <description>&lt;p&gt;Noticed that you have LiURL.cn in there also.&lt;/p&gt;

&lt;p&gt;Cool.&lt;/p&gt;

&lt;p&gt;API for that is described here - &lt;a href=&quot;http://blog.liurl.cn/2009/03/api-stuff/&quot;&gt;http://blog.liurl.cn/2009/03/api-stuff/&lt;/a&gt;
&lt;br /&gt;Its fairly simple.  Sample code also available on our blog under API posts.&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;

&lt;p&gt;Lawrence.&lt;/p&gt;</description>
      <pubDate>Tue, 21 Apr 2009 05:43:24 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:25262:113126</guid>
      <author>lawrencesheed</author>
      <link>http://userscripts.org/posts/113126</link>
    </item>
    <item>
      <title>Need Help using your script, replied by StevenD</title>
      <description>&lt;p&gt;Thank you very much for your reply!  I will certainly take a look at the scripts you listed (I didn't know we could search by tags here!)
&lt;br /&gt;I am going to try what you have suggested and let you know!  Thanks again for your reply.&lt;/p&gt;</description>
      <pubDate>Sun, 19 Apr 2009 00:23:48 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:25064:112202</guid>
      <author>StevenD</author>
      <link>http://userscripts.org/posts/112202</link>
    </item>
    <item>
      <title>Need Help using your script, replied by Johan Sundstr&#246;m</title>
      <description>&lt;p&gt;Potential candidates for unpagination is any page that was cookie-cutter-template-wise turned into multiple pages between which there are &quot;next&quot; links, or &quot;page 1..N&quot; links, of any sort. Anything you can craft an XPath expression for picking up on -- &lt;code&gt;//a[.=&quot;next&quot;]&lt;/code&gt; is an easy case, but it can be anything that is deterministic enough to be expressed in the language, which is very rich in its possibilities (peek at the very minimal &quot;source code&quot; of some of &lt;a href=&quot;http://userscripts.org/tags/microformat%20producer&quot;&gt;these scripts&lt;/a&gt; for inspiration, if you are new to it).&lt;/p&gt;

&lt;p&gt;When I look for XPath expressions, I use Firebug's Inspect feature a lot -- open the Firebug console, click &quot;Inspect&quot; on top, and click on the next link. Let's say we're on page 2 right now and it comes up with an HTML structure that looks like this (a somewhat common and maybe-not-that-trivial one, for a budding XPath hacker):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;pre&gt;
&amp;lt;div id=&quot;comments&quot;&gt;
  &amp;lt;a href=&quot;...&quot;&gt;1&amp;lt;/a&gt; 2 &amp;lt;a href=&quot;...&quot;&gt;3&amp;lt;/a&gt;
&amp;lt;/div&gt;&lt;/pre&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;My strategy in this case will be &quot;among all the page links, select the first one that follows a not-just-whitespace text node&quot;, which will probably work on page 1 to N-1, which happens to be all pages we need a next link from. (For a tricky case where multiple strategies are needed, craft an expression like 'how-to-do-it-on-some-pages | how-to-do-it-on-other-pages | how-to-do-it-on-yet-other-pages | ...'.)&lt;/p&gt;

&lt;p&gt;In this case, the above comes out, for instance (untested -- if you have some example page in mind though, feel free to name its URL), &lt;code&gt;id(&quot;comments&quot;)/a[(preceding-sibling::*[1])[length(normalize-space(.))&gt;0]]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It's easy to try the expression in Firebug; just try $x('id(&quot;comments&quot;)...') in the Firebug console and see what it found. If the first node is your next link, and if that is the case on not just this page, but any page in the sequence (try the first page, one in the middle somewhere, the last but one page and the last one -- which should come up empty), and you'll probably be reasonably certain you got it right.&lt;/p&gt;

&lt;p&gt;Facebook evolves quicker than the frequency of my visits or active use of the site; my hack has in all likelihood rotted long ago.&lt;/p&gt;</description>
      <pubDate>Sat, 18 Apr 2009 19:03:01 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:25064:112144</guid>
      <author>Johan Sundstr&#246;m</author>
      <link>http://userscripts.org/posts/112144</link>
    </item>
    <item>
      <title>Need Help using your script, replied by StevenD</title>
      <description>&lt;p&gt;Hello Mr. Sundstrom.&lt;/p&gt;

&lt;p&gt;  First, thank you for sharing this script and also for your blog.  It is very thought provoking!&lt;/p&gt;

&lt;p&gt;  I have a couple of questions for you, if you don't mind.  How do I identify potential candidates for your script?  (and) How do I then go about writing the customized calls to the unpaginate function?&lt;/p&gt;

&lt;p&gt;  For my first question, does this script only work with sites that use 'NEXT'?  I am interested in unpaginating a site that includes links to the numbered result pages, but does not provide a next link.  If this script would work with numbered links that lack a 'NEXT' link, what would my custom script look like (any examples?)&lt;/p&gt;

&lt;p&gt;  Secondly, I looked at the facebook search unpagination script you have but was unable to match up the xpath statements with current search results.  Does that script still work?  If yes, then may I ask how you derive the id's you have in the script.  I ask that since I would like to create a customized version for the site I visit.&lt;/p&gt;

&lt;p&gt;  I hope my questions are clear and I appreciate any time you provide in answering my questions!  Thanks in advance, StevenD&lt;/p&gt;</description>
      <pubDate>Sat, 18 Apr 2009 04:10:18 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:25064:111942</guid>
      <author>StevenD</author>
      <link>http://userscripts.org/posts/111942</link>
    </item>
    <item>
      <title>Profiles with no awards don't load, replied by JamMasterClay</title>
      <description>&lt;p&gt;It seems that if someone has no personality awards, their page won't load at all - I just get a blank white area where their profile should be. Also, I had to add exceptions for the different tabs of peoples profiles so that the tabs would load...FYI.&lt;/p&gt;</description>
      <pubDate>Thu, 02 Apr 2009 17:46:38 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:24241:107724</guid>
      <author>JamMasterClay</author>
      <link>http://userscripts.org/posts/107724</link>
    </item>
    <item>
      <title>Version for UI2?, replied by Chris4</title>
      <description>&lt;p&gt;I'd also like to see an update!&lt;/p&gt;</description>
      <pubDate>Sat, 28 Mar 2009 10:01:37 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:22537:106248</guid>
      <author>Chris4</author>
      <link>http://userscripts.org/posts/106248</link>
    </item>
    <item>
      <title>OKCupid has re-arranged their page structure again, replied by Tim McCormack</title>
      <description>&lt;p&gt;And you added +/=/- icons. Sweet!&lt;/p&gt;</description>
      <pubDate>Mon, 23 Mar 2009 01:40:47 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19531:104824</guid>
      <author>Tim McCormack</author>
      <link>http://userscripts.org/posts/104824</link>
    </item>
    <item>
      <title>OKCupid has re-arranged their page structure again, replied by Johan Sundstr&#246;m</title>
      <description>&lt;p&gt;Fixed.&lt;/p&gt;</description>
      <pubDate>Sun, 22 Mar 2009 04:46:51 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:19531:104583</guid>
      <author>Johan Sundstr&#246;m</author>
      <link>http://userscripts.org/posts/104583</link>
    </item>
    <item>
      <title>Script does not work anymore in Firefox 3.1 beta 3, replied by Johan Sundstr&#246;m</title>
      <description>&lt;p&gt;Dang, that's a shame. Oh, well; guess I'll change to a messier solution next update.&lt;/p&gt;</description>
      <pubDate>Sun, 22 Mar 2009 01:07:34 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:23335:104553</guid>
      <author>Johan Sundstr&#246;m</author>
      <link>http://userscripts.org/posts/104553</link>
    </item>
    <item>
      <title>Script does not work anymore in Firefox 3.1 beta 3, replied by Bun Bun</title>
      <description>&lt;p&gt;Cause seems to be the use of a sharp variable:&lt;/p&gt;

&lt;p&gt;Error: invalid sharp variable use #1#
&lt;br /&gt;Source File: gamedata.js
&lt;br /&gt;Line: 245&lt;/p&gt;

&lt;p&gt;Sharp variables are discouraged by Mozilla (&lt;a href=&quot;https://developer.mozilla.org/en/Sharp_variables_in_JavaScript&quot;&gt;https://developer.mozilla.org/en/Sharp_variable...&lt;/a&gt;) and only seem to work with Spidermonkey; Tracemonkey doesn't seem to support them anymore.&lt;/p&gt;</description>
      <pubDate>Tue, 17 Mar 2009 13:57:07 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:23335:103270</guid>
      <author>Bun Bun</author>
      <link>http://userscripts.org/posts/103270</link>
    </item>
    <item>
      <title>Better version, replied by Jonatron</title>
      <description>This works better.  Don't make me fork it:
&lt;pre&gt;
unsafeWindow.addComment = function paragraphify(id) {

  var form = document.forms.namedItem(id);

  var text = form.elements.namedItem(&quot;text&quot;);

  text.value = '&lt;p&gt;' + text.value
  text.value = text.value.replace(/(\n+)/g,'&lt;/p&gt;&lt;p&gt;$1');
  text.value = text.value + '&lt;/p&gt;'

  addComment(id);

};

&lt;/pre&gt;</description>
      <pubDate>Thu, 12 Mar 2009 01:59:54 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:23048:101998</guid>
      <author>Jonatron</author>
      <link>http://userscripts.org/posts/101998</link>
    </item>
  </channel>
</rss>
