userscripts.org Favourites

Last update on Sep 7, 2008

Allows you to put your favourite user scripts into a dropdown menu integrated with the site's main menu. It shows useful information about each script, including when it was last updated.

The script replaces the "Add to favorites" link under "view script source" to add/remove the script to your favourites. A dropdown menu containing the favourites appears next to the "Scripts" link in the header.

In the dropdown, the items first appear in chronological order (i.e. the order in which they were added to your favourites). You can then sort them using the links at the top. Clicking the same one reverses sorting direction and the script remembers the sorting type. You can also change the title by double-clicking it.

Next to each item, the number of comments (c), installs (i) and the time of last update (u) are shown. The script updates this information when it is run 30 minutes after the last update (i.e. it won't update every 30m without a page refresh). The tooltip for each item's link shows the time & date it was added.

If you update the script (by clicking "Install Script" on the right) your current favourites will be kept.


Update 27 May 2008: Fixed a few bugs mostly due to site changes. linkType 2 works again and a "Refresh" link to refresh the stats has been added next to the sorting links.

Update 23 March 2008: Favourites are now saved when updating the script. Script now works if logged in or not.

Update 15 March 2008: Added ability to sort by author. This just means that scripts written by you will appear at the top/bottom. Also, scripts written by you are in italics. Fixed comment-adding to reflect site changes.

Update 4 March 2008: Minor CSS change to make it work in Firefox 3.

Update 17 November: You can now edit the title of the item in the list by double-clicking it. Normal clicks still follow the links as usual. You can also set the title to get automatically truncated using the truncateTo variable at the top of the script. Currently it is set at 70 and will truncate long titles, adding a trailing ellipsis (...).

Screenshots

Not added to favourites, favourites not open:



Added to favourites, favourites open:






You could comment on this script if you were logged in.

55 comments Feed-icon

1 point
login to vote
jerone scriptwright
Posted Oct 1, 2008

I need to add z-index:9999; to #favourites as style to get I above the metadata.

1 point
login to vote
avg scriptwright
Posted Sep 30, 2008
1 point
login to vote
Raffles script's author
Posted Sep 30, 2008

I'm aware that the comments counter is broken after the update to the comments system. I'll fix it when I have time.

1 point
login to vote
jerone scriptwright
Posted Sep 8, 2008

I guess, thnx anyways. Still loving your script.

1 point
login to vote
Raffles script's author
Posted Sep 7, 2008

OK, done.

That must have been a caching issue of some sort. Odd.

1 point
login to vote
jerone scriptwright
Posted Sep 7, 2008

It cases trouble when a script injects an iframe into the window and there are a few useful userscripts here who do (including one of mine).
Beside, it's an easy fix :p

For the second problem, I restarted my browser just before and the problem disappeared.

1 point
login to vote
Raffles script's author
Posted Sep 7, 2008

I don't understand - why would that be necessary? I can't find any instance when the header is not present.

As for the second problem, I can't reproduce that. I have a number of script that have not been updated since they were first uploaded and u: always shows the first uploaded time. The script already uses the "First uploaded" time - lines 111 and 322.

1 point
login to vote
jerone scriptwright
Posted Sep 7, 2008

Thats great news, thnx.

I've a little suggestion:
change lines 163 and 164 to something like this:

  var navitems = document.getElementById('header');
        if (!navitems) return;
        navitems = navitems.getElementsByTagName('li');
        if (!navitems) return;
This prevents errors with other scripts.

Another problem I came across, was times/dates with scripts like this one; they don't have a "Last updated" time/date. The result is that it always show like this: "u: 12 h ago" and almost every time shows on top when sorted. The solution is to use the first uploaded time (until the "Last updated" is added). I hope you understand my problem and you can fix it.

1 point
login to vote
Raffles script's author
Posted Sep 6, 2008

Thanks jerone, I found the error: I was using "First Updated" instead of "First updated". Tiny mistake!

Script has been updated.

1 point
login to vote
jerone scriptwright
Posted Jul 26, 2008

Hello Raffles,

Every time I click "Refresh" I'm getting the following error in Firebug:

page.match(/(Last updated|First Uploaded)<\/h6>\s+ <p>([\w\s,]+)\.<\/p>/) has no properties
      updateItem("12497", Object)greasemonkey.js (line 668)
      (no name)()greasemonkey.js (line 370)

It goes the same for these script numbers: 12497, 3548, 9726, 3412, 30490, 675, 1641.
Can't find any matches between these scripts, but maybe you know what happens.
I've got 41 scripts favourited atm.

Also I've got some small space between the 'Favourites' word and the popuped div. I've fixed it by chancing top: 1.7em to top: 18px.

I don't know if anyone else get these errors too?!

ps. I can't recreate the previous problem and forget about that translation suggestion, you made a good point.

1 point
login to vote
Posted Jul 19, 2008

Real nice. I wish the 50 faves I had added before this script could somehow be transferred. But I know that's asking too much. Great job tho this is a must have!

1 point
login to vote
Raffles script's author
Posted Jun 7, 2008

I've added a small feature: if a script has new comments (i.e. a different number from last time), one of these (ยป) is displayed before the number of comments.

1 point
login to vote
Raffles script's author
Posted Jun 3, 2008

Do you mean that it goes into some other order, different to the order you had them in before pressing "Refresh"? That doesn't happen to me, the order stays as it it, and it should, because the list items are not moved or removed at all, only the elements inside each are changed.

As for multiple languages, I find it curious that you would want that, as the rest of the site is in English. Wouldn't it clash horribly? Something I'd rather tackle first is the synchronisation with the site's system.

1 point
login to vote
jerone scriptwright
Posted Jun 3, 2008

Still loving your script.

Only comment I have that when I press "refresh" the list below doesn't reorder when I have them sorted on "last update". To fix this the list should be reordered when refreshing is finished.

Do you've got plans in making this script multi-language?
If yes, maybe my script (US_language) would be interesting for you then and I would like to contribute a Dutch translation.

gr J

1 point
login to vote
Noxumbra scriptwright
Posted Jun 2, 2008

Thanks for the fix! I love the famfamfam icons :)

1 point
login to vote
Raffles script's author
Posted May 30, 2008

Thanks for pointing that out, Gollum. I've updated it to accommodate scripts that haven't been updated and only have a "First uploaded" date.

lastupdated = xpath('//div[@id="right"]/h6[contains(text(), "Last updated") or
        contains(text(), "First uploaded")]/following-sibling::p/text()', true)

1 point
login to vote
gollum scriptwright
Posted May 30, 2008

I also use Update scripts, shifting "Favourites" leftward. Which meant editing the css for the #favourites container to left:-17em;
Not asking you to do anything to your script, but it may help others who find the left edge of "Favourites" guillotined .

1 point
login to vote
Jeton user
Posted May 30, 2008

Raffles, great to hear that. Thanks for your time.

1 point
login to vote
gollum scriptwright
Posted May 30, 2008

Script page (h6) header can now be Last updated + First uploaded or just First uploaded. If the latter then script falls over with xpath error.
EDIT: ...script now updated.

1 point
login to vote
Raffles script's author
Posted May 29, 2008

jeton: Like I said, my system is completely separate. That is why there are different numbers for each system.

Now that I think about it, I think synchronisation would be a good idea. I'll work on it when I have time.

1 point
login to vote
Jeton user
Posted May 29, 2008

Here's a screenshot explaining the issue:
http://dl.getdropbox.com/u/4639/usrscrfav.gif

On nr.1 userscripts.org shows that i have 11 favorite scripts. On nr.2 your script displays only 7.
Is your scripts "syncing" with the userscripts.org favorites or it works on it's own?
If so, could you make it sync? :)

1 point
login to vote
Raffles script's author
Posted May 28, 2008

Cheers jerone, should be working again.

1 point
login to vote
jerone scriptwright
Posted May 27, 2008

Ok, I tested a bit and found out that it only is when linkType is set to 2 (which i prefer).

p.s. Don't forget to update your update list above.

1 point
login to vote
ozzii user
Posted May 27, 2008

Thanks for the update.
I will test this at home. At work all is OK, but I didn't have updated the script.

1 point
login to vote
Raffles script's author
Posted May 26, 2008

As requested by jerone, I've added a "Refresh" link, next to the sorting links. You can tell when it's refreshing and when it's finished. While it's refreshing the stats, clicking the link again does nothing.

You could comment on this script if you were logged in.