digg - add mirrors

By Jordi De Groof Last update Mar 31, 2009 — Installed 12,688 times. Daily Installs: 4, 4, 3, 6, 9, 3, 2, 0, 2, 2, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 2, 2, 3, 4, 1, 4, 4, 0

Archived Comments (locked)

Subscribe to Archived Comments 28 posts, 10 voices

Jesse Andrews Admin

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

 
Jordi De Groof Script's Author

Ayush: the script is compatible again with opera, although automatic mirror selection won't work, since it requires GM_xmlhttpRequest, which Opera doesn't provide.

 
Ayush User

Compatible with Opera.

Not true. See: http://my.opera.com/community/forums/findpost.p...

 
Jordi De Groof Script's Author

Bug fixed, thanks jackyyll

 
jackyyll Scriptwright

Also, lines 128 and 134 need the same updates.

 
jackyyll Scriptwright

Since the new comment system adds /all to the url, the mirror links don't work in the story if you have all comments expanded. To fix this line 123 should read:

dugglink= window.location.href.replace(/\/all/, '');

 
Daniel Einsp... Scriptwright

Hey, Sorry, just one more problem, you don't have the @identifier tag in your header comments anymore, the updates script uses that string and it is reporting an error when checking your script because it's missing.

 
Daniel Einsp... Scriptwright

Cool stuff. I don't think your update stuff is set up quite right though. You need to be using an unsafeWindow to request the update checking, and your date needs to subtract one from the month because JS uses 0 to 11 for the month argument.

You can take a look at my script if you want, I just finished testing out my changes to use UserScriptUpdates and got it working right.

 
Daniel Einsp... Scriptwright

Also, the order is based on install (not update) order. So if yours was before mine and you wanted it to be after, you'd remove your script (so it is no longer in the list at all) then reinstall it. Just updating a script doesn't change the ordering.

Obviously this would be an advanced thing, but honestly, I don't imagine too many people would care either way and those that would care can easily figure out how to fix it. :)

 
Daniel Einsp... Scriptwright

I've found that the order listed in the manage scripts dialog is the order of execution. For instance, if my script is above yours in the list, your mirror links will have my #digg_link marker, but if yours is first, they won't.

 
Jordi De Groof Script's Author

Daniel, I believe this must be possible, however we have to ensure that my script executes after yours, and I've got no idea how to do that.

 
Daniel Einsp... Scriptwright

I like this mirror script better than many of the others I have tried.
Yours is the first I've seen that adds the icons to the digg it widget. That actually got me to thinking..

Do you think there is any chance you could tweak your script to be able to instrument my Add Digg Control widget with the links? That would be really kewl for me since sometimes, I open a link in the background and then when I get to that tab to read it, I see the FF error page with my ADC widget on it. If I had the mirror buttons right there, it would be nifty! :) I'm sure I could do it myself, but rather than copying your code I thought I'd ask to see if it could be part of your script first.

 
Yosaif User

sweet...thx

 
Josh Bancroft User

w00t! I was install number 3000! :-)

 
SpookyET Scriptwright

Like I said, Firefox can be annoying. What may be fast on my system can be the exact opposite on another system. I have no idea how to reliably test javascript speed.

 
Jordi De Groof Script's Author

SpookeyET: I timed our scripts using the exact same method, and according to me, my script runs 30-50ms faster than yours, except on the story pages, where they have the exact same speed.
Are you sure you're using the latest version of my script?

 
SpookyET Scriptwright

I timed your script and my script using Firebug's timer feature ( unsafeWindow.console.time("name"); unsafeWindow.console.timeEnd("name"); ). On avery, my script runs 50-60ms faster.

 
SpookyET Scriptwright

I think I fixed the speed problem now.

 
Jordi De Groof Script's Author

SpookyET: although xpath might be slower, my overall code now is faster than yours, so the xpath probably isn't that much of an issue.

 
SpookyET Scriptwright

XPATH is horribly slow. Google around for benchmarks. It's ungodly slow. I don't use it unless I really have to.

 
Jordi De Groof Script's Author

The script is now as fast as the one SpookyET made.

 
SpookyET Scriptwright

My script is faster: http://userscripts.org/scripts/source/7902

 
Jordi De Groof Script's Author

Now mirrors are also added to the #1 stories on a users page.

 
Jordi De Groof Script's Author

The mirrors now follow your digg preferences to open in a new tab or not.

 
Jordi De Groof Script's Author

surplus: the icons have the same size as all the other scripts that add mirrors to digg. Plus if the icons would be bigger, it wouldn't fit on one line anymore.

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