Helgon.net avatars in user listings

By Henrik N Last update Aug 23, 2005 — Installed 1,621 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 19 posts, 4 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
Henrik N Script's Author

Completely rewritten to be less embarrassing and easier to maintain.

To the uncaring end-user, it's just a bit faster and less likely to break.

News under the hood include: caching in a single GM_value, caching the state of users without avatars as well to keep down traffic, re-caching avatars on onerror instead of by HEAD requests.

 
Henrik N Script's Author

Updated due to server changes ("Latest visitors" page URL changed).

 
Henrik N Script's Author

Updated due to server changes.

 
Henrik N Script's Author

Updated for new servers again. Userscripts complains it's not properly formatted (but it is, as far as I can tell, and it works), so get it here: http://henrik.nyh.se/greasemonkey/helgonavatars...

 
Henrik N Script's Author

Updated script for new servers.

 
Henrik N Script's Author

They changed image URLs again; script needs updating. Will do when I find the time...

 
Henrik N Script's Author

Added persistent cache through GM_setValue().

 
Henrik N Script's Author

Johan: Not sure what you mean about the regexps. I see I had escaped a couple of forward slashes unnecessarily in a RegExp(), but what do you mean about string quoting backslashes? The only backslashes in my RegExp():s are for escaping things like ? (for a literal question mark) and . (for a literal full stop). If I double those backslashes, the script hangs.

On a side note, I've modified the script to cache more persistently through GM_setValue instead of within the frameset, though I won't update it here until I've tested it a bit more.

 
Johan Sundström Scriptwright

I added a scoop-up-incidental-avatar-URLs-seen bit today; it's just a line or two extra, marked "// register in cache" in my version.

Your regexps probably don't do quite what you want them to, by the way -- if you use the "new RegExp('a regexp')" syntax, remember to string quote all occurrences of "\" (to "\\"). If you use the literal syntax, it's the "/"s you need to quote (to "\/"), and if you don't, there is no need to quote them at all.

 
Henrik N Script's Author

Johan: Cool, will check it out tomorrow. I have considered a cache, but I suppose you beat me to it.

Updated again since Helgon changed avatar servers. :p

 
Johan Sundström Scriptwright

Dang, were you updating it yesterday, too? :-] Oh, well - for what it's worth, I did a version that caches avatars rather than going astray to fetch them again and again every time, being a bit kinder on the helgon.net server (and speedy as a greased weasel. monkey. whatever :-).

The (function(){...})(); encasing is performed internally since GreaseMonkey 0.3.3, and you might want to start splitting things up into functions for readability. :)

Have a peek at my refactored version at http://www.lysator.liu.se/~jhs/userscript/www.h... for some inspiration. I couldn't resist tampering with it to do some other amusing things too, while playing.

 
Henrik N Script's Author

Updated: no longer reports visits when retrieving avatars. 125 new lines of code. :p

 
Henrik N Script's Author

Thanks! I've updated the script accordingly. A shame "for (foo in bar)" isn't reliable. I miss Python. ;)

 
Arvid Scriptwright

i tried changing the includes, but that was't the problem the problem was this line:
"for (var i in links) {"
i changed it into "for (var i = 0; i < links.length; i++) {" works like a charm now. I think it has something to do with me using Deer Park. I generally avoid "for (foo in bar)". Anyway, great script!

 
Henrik N Script's Author

Hm, I debugged it a bit. I tried the purple color scheme (saw you use it, from your screenshots) and it worked fine. It did not work, however, when I logged in through http://helgon.net as opposed to http://www.helgon.net. I've now fixed the @include:s to work in both cases. Let me know if this solves your problem.

 
Henrik N Script's Author

Let me know how it works when you've tried it out more. I had a friend try it and it worked fine for him.

 
Arvid Scriptwright

though i can't get it working in my "Besökarlista". Actually, i haven't tried it anywhere else, so i can't say if it works at all.

 
Arvid Scriptwright

nice, i'm thinking about adding some scripts i wrote for helgon sometime soon. check em out :)

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel