GM script: Link to referenced image

Mar 20, 2006 19:42

I wrote a Greasemonkey script that will attempt to link references in comments to images in posts. So if someone has posted ten images, a comment like "I like the second to last picture" will contain a link back up to the ninth image. Like this:


Read more... )

Leave a comment

Comments 53

cacahuate March 20 2006, 20:19:09 UTC
Cool!

Reply


(The comment has been removed)

malesca March 20 2006, 20:28:41 UTC
I'm afraid I have no idea, since I don't use Opera. It very well might work, since it's not using any Greasemonkey specific functions.

Reply

anotherdream March 20 2006, 21:34:46 UTC
It doesn't appear to work in Opera (8.52): it causes an error on the page. HEre's what the JavaScript console says:

Unknown thread
Syntax error C:\Program Files\Opera\profile\scripts\3567.user.js: line 17 of User JS script :
if (count_imgs < 2) return; // Only continue if there is mo
---------------------------^

Reply

(The comment has been removed)


getbacknow March 20 2006, 21:28:11 UTC
I'm not sure how to edit the userscript myself, but as I was testing out by reading the comments of picture communities, references like "third from last" will be split into a link to the third picture and a link to the last. Seems that all other types of references are covered, though!

Reply

malesca March 20 2006, 21:33:41 UTC
Missed that one, thanks for pointing it out! Updated the script: http://www.userscripts.org/scripts/source/3567.user.js

Reply


ex_ga_woo March 20 2006, 22:01:47 UTC
Modified it to provide thumbnails of the images being linked to. (

Doesn't work well for "first n": Thumnail of only the first image is created, though it works for "last n". I tried to find out what's wrong, but it looked as if I'll have to change those regexps. So I gave up.

P.S: Script uses your namespace and script name, so it will over-ride your script if installed.

P.P.S: Means nothing that I uploaded it to userscripts.org. It's still your copyright. I just don't have webspace anywhere else :D

Reply

malesca March 20 2006, 22:07:57 UTC
That's a great idea. I don't mind my scripts being modified and re-distributed, but perhaps you could rename the script and modify the description, so there isn't two scripts on userscripts.org that appear to be similar? Call it "LiveJournal link to referenced image, with thumbnails" or something.

I might well incorporate something like that in a future version of the script, if you don't mind. Though I think I'll make the thumbnail appear in some sort of tooltip.

Reply

malesca March 20 2006, 22:08:54 UTC
"aren't two scripts that appear to be identical", rather...

Reply

ex_ga_woo March 20 2006, 22:36:31 UTC
I was hoping you'd say that you're going to include thumbnails in your script right now. So that I could delete the script I uploaded. Which is why I didn't even bother changing the name of the script. Or fix that "first n" problem I'm having. Anyway, I've changed the name and namespace now. And I'm not tagging the script; so not many will land on that page anyway.

Reply


q_pheevr March 20 2006, 22:39:43 UTC

I really like the pictures immediately before and after the antepenultimate one, and every third one before the nineteenth except for the prime-numbered ones.

(I'm sorry. This is a realy neat idea; I just enjoy making life difficult.)

Reply

malesca March 20 2006, 23:14:38 UTC
:D Yeah, there are loads of difficult cases, both in the direction of undergenerating and overgenerating. Some I came across were things like "I like the third picture in the second set" and "I was born on May 11th"...

Reply

trochee March 23 2006, 05:35:44 UTC
yay! another linguist made this joke before I had to! I was about to link it and say "look, a GreaseMonkey hack that does coreference resolution".

ah the lazyweb. One doesn't even have to be clever -- one can just wait and clever comes along anyway.

Reply

malesca March 23 2006, 08:45:48 UTC
Well, I do study computational linguistics. I suppose I could make this cleverer as my degree thesis. ;)

Reply


Leave a comment

Up