LibraryThing Hack Projects - sound off!

DiscussionsHacking LibraryThing

Rejoignez LibraryThing pour poster.

LibraryThing Hack Projects - sound off!

Ce sujet est actuellement indiqué comme "en sommeil"—le dernier message date de plus de 90 jours. Vous pouvez le réveiller en postant une réponse.

1brightcopy
Modifié : Fév 11, 2010, 9:37 am

I just thought I'd start a thread where each author can post a link to their LibraryThing Greasemonkey scripts or Stylish scripts or userContent.css hacks or whatever.

If someone wants to discuss a specific hack, it's probably best to do it in a separate thread. That way people can come here and just skip through the thread to see all the projects out there.

Sound good? Let the sounding off begin!

2brightcopy
Modifié : Fév 23, 2010, 12:16 pm

Okay, I'll start. Here's what I've done so far:

LibraryThing Employee Highlighter

This script will color both the header and the message body of posts made by LibraryThing employees. It will also add a border to the heading and a little padding to make everything look tidy with the new background color.

There are several script commands that can be accessed by right clicking on the monkey icon at the bottom of your browser and clicking User Script Commands....
(see the above link for configuration settings)

LibraryThing Expand More on Add Books

This script will both expand all the More buttons on the page and hide the More links. This is done purely through CSS styles, so hopefully there's little risk of breakage when the site is updated.

3aethercowboy
Modifié : Fév 23, 2010, 2:10 pm

So far, only GreaseMonkey Scripts (links directly to the user.js files):

LibraryThing Ignore User (superseded by Tim's added functionality to Block User; UPDATED to completely remove offending users' posts)
LibraryThing Member Why? - Collapses the reasons for a member recommendation, like on the other two recommendation pages.
LibraryThing MyIcon - Gives you an icon on your talk posts.
LibraryThing Fix Images - Resizes too-large placeholder images and fixes bad URL for green checkmarks.

4brightcopy
Modifié : Fév 23, 2010, 12:14 pm

LibraryThing Add Worldcat on Add Books Page

Adds a "search worldcat" link below the search box on the Add Books page. Clicking on it will open a new window that will go to the WorldCat website and show the results for the search text in Books.

5legallypuzzled
Jan 16, 2010, 8:12 am

LibraryThing Select Firefox extension - add books by highlighting and right-clicking (Firefox only)

Amazon bookmarklet (still testing) - fixes bug in current LT Amazon bookmarklet

I also wrote a Greasemonkey script to fix Talk way back when the links were coded as JavaScript. It's not useful anymore, but in the interest of completeness, here it is.

6Collectorator
Modifié : Jan 16, 2010, 2:25 pm

Ce utilisateur a été suspendu du site.

7brightcopy
Modifié : Fév 23, 2010, 12:13 pm

LibraryThing Talk and Groups Link Fixer

Changes the main Talk link to always point to your posts and the Groups link to always point to your groups

8timepiece
Jan 17, 2010, 11:29 am

LT Add Book searchplugin (works very nicely in combination with Context Search)

LT tweaks style (possibly deprecated by recent changes)

9brightcopy
Modifié : Fév 23, 2010, 12:14 pm

LibraryThing Editions Escalator

For users who have screen height problems, this script moves the frequently used Editions link to the top of the book information screen. It also compacts some of the spacing so more links can fit vertically.

10brightcopy
Modifié : Fév 23, 2010, 12:14 pm

LibraryThing Amazon Image Highlighter

Attempts to find any covers on the page that have been loaded from Amazon and draws a distinctive (configurable) border around them. The script actually searches all IMG tags on the page, including those added later through dynamic methods. It may not be able to find all Amazon images if the page is coded in such a way that the image is returned from a SRC that does not contain http://images.amazon.com. For example, the image thumbnails on the Add books search results screen will not be highlighted.

The goal is to make it easy to quickly scan through books and see which covers need to be replaced with user-provided ones.

Important Note: This is one of my more intensive scripts. It scans every single LibraryThing page and also reacts when the site dynamically creates content after the page loads. As such, it might not be a bad idea to turn the script off when not actively seeking to eliminate Amazon covers.

11brightcopy
Modifié : Fév 23, 2010, 12:12 pm

LibraryThing Search Group Subject Lines

Adds a button on the groups page next to the Search button, labeled Search Subject. Clicking on it will open a window with a Google search that will search for the exact text entered in the search box. This search will only search the titles of talk pages, thus effectively allowing a subject-only search. It will also specify that the group name must be in the title. This should limit the search to only that group. However, it can be fooled. For example, if you searched for "checkmark" in the group "Bug Collectors", it would find a post in "Recommended Site Improvements" with the title "Neat post in Bug Collectors about checkmarks."

12aethercowboy
Jan 18, 2010, 1:12 pm

Google Books LibraryThing ISBN-linker - Takes the ISBNs in the Google Books book page ("More book information" section), and converts them to "_new" links pointing to corresponding LibraryThing work pages (ignorant of whether book is actually in LT).

This one could use some suggestions as to where to go with it.

13DaynaRT
Jan 18, 2010, 1:16 pm

>12 aethercowboy:
Holy crap, that is insanely awesome.

14aethercowboy
Fév 3, 2010, 7:02 pm

>13 DaynaRT:.

I just realized how insanely awesome it was when I was using Google Books for adding CK info.

Also:

http://sites.google.com/site/jacobsilvia/code/lt_hide_dupes.user.js

This one hides duplicate reviews (multiple reviews written by the same user).

15brightcopy
Modifié : Fév 23, 2010, 12:11 pm

LibraryThing Filter Local Events

On the Local event list, there are frequently many events that are recurring junk such as Border's Bean Friday. If you have several Borders in your metroplex, you'll get scads of events just for that one thing that you're likely never to be interested in. This is where LibraryThing Filter Local Events comes in. You can add filters to your Upcoming local events listing on the Local tab. Hidden events can be shown and will have a gray background. It also highlights any events you have marked as a favorite.

16brightcopy
Modifié : Fév 23, 2010, 12:12 pm

LibraryThing Catalog Print Cleanup (Stylish Addon script)

This style will remove the footer from the bottom of printed LibraryThing catalogs.

17JonathanGorman
Modifié : Fév 11, 2010, 11:12 am

Finally got around to at least posting the quick fix that I did a while back (I posted another topic that details how the fix works.

A very simple Stylish sheet/link for those folks who don't want to copy the css themselves ;)..

LibraryThing - Touchstones Link Fix

This should fix the touchstones so when you click on them you get a choice of highlighting the work (doesn't work) or clicking a link to go to to the work page.

* edited to fix the link, sorry about that. I blame my dog for distracting me while I was posting something ;).

18aethercowboy
Fév 11, 2010, 9:58 am

>17 JonathanGorman:

For those trying to click that link, point your browser instead to:

userstyles.org/styles/25091

19brightcopy
Modifié : Fév 23, 2010, 12:11 pm

LibraryThing Sort and Re-link on Combine/Separate Pages

This script will make two major changes to the author combination page and the work editions page. One both changes, a new link will be shown to allow you to sort the editions alphabetically. In the case of the combinations page, each work will have its own sort link. It will also change the links to "separate" so that you can easily open them as new windows or tabs. Prior to having this script, all "separate" links were javascript links that could only be opened in the current window, thus causing you to continually have to go back to the main page when you were doing a lot of separations.

The alphabetizing is done by throwing out any punctuation or whitespace characters before alphabetizing. It is also case-sensitive, but only if the two titles being compared are otherwise the same. Both of these changes are geared towards readability and grouping of similar titles together rather than strictly alphabetizing.

20brightcopy
Fév 23, 2010, 12:10 pm

LibraryThing Tabs for Picture Galleries

Adds Picture and Junk tabs to your main list of tabs. These tabs will take you to your picture gallery and junk drawer, respectively. If you are currently in either gallery, the tab will show as active. If you are viewing a picture, the Pictures tab will show as active, as there is no way to discriminate between viewing a picture from the main picture gallery and from the junk drawer.

21brightcopy
Mar 20, 2010, 1:24 am

LibraryThing Named Styles

With this script, the edit styles screen now has new options for each style. You can enter a new caption for the style buttons that normally show A, B, C, D, or E. You can also change the popup hint that will appear when you move your mouse over those fields. These settings are saved when you click the normal Save changes button on that screen.

22brightcopy
Avr 10, 2011, 4:21 pm

LibraryThing Work Editions Grid

Changes the editions display on the work pages to a sortable grid.

(discussion at http://www.librarything.com/topic/113902)

23brightcopy
Modifié : Avr 18, 2011, 12:49 am

LibraryThing Work Page Member Search

Changes member name links on the work pages so that instead of the member's profile, they point to a search of that member's catalog for the work title. For example, all the member names under "Recently added by" or "All members who have the book" have their links changed. This can make it very easy to find the actual book(s) each member has listed that are rolled up into the work.

Note: It will not currently work on the links under "All members who have the book" if you have to click on the "( Show all members )" link to show them.

24anglemark
Modifié : Avr 18, 2011, 9:42 am

Nevermind, when I reloaded the page, it worked.

25EveleenM
Avr 18, 2011, 2:08 pm

#23 That's great, brightcopy! It will be really useful for checking books without ISBNs.

26brightcopy
Modifié : Avr 18, 2011, 10:36 pm

Updated the LibraryThing Work Page Member Search script. Details here

27brightcopy
Modifié : Mai 10, 2011, 9:17 pm

Bookmarklet to sort all the tags combined together on the tag page.

Sorts and puts each tag in the "Includes" section on a separate line for easy scanning. Also sorts the tags in the dropdown list for tag separation.

javascript:(function(){var p=document.evaluate ('//p[class="alsoknownas"]',document.body,null, XPathResult.ANY_UNORDERED_NODE_TYPE,null).singleNodeValue; var e=document.evaluate('.//a[starts-with(href,"/tag")]',p,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null); var a=[]; var i;for(i=0;i<e.snapshotLength;i++) a.push(e.snapshotItem(i).textContent); a.sort(); var html=''; for(i=0;i<a.length;i++) html+='<a class="alwaysgrey" href="/tag/'+ encodeURIComponent(a[i]).replace(/%20/g,'+')+'">'+a[i]+'</a><br>'; p.innerHTML=html; f=document.evaluate('//select[id="totag"]',document.body,null, XPathResult.ANY_UNORDERED_NODE_TYPE,null).singleNodeValue.innerHTML ='<option>'+a.join('</option><option>')+'</option>'}())

28brightcopy
Modifié : Mai 10, 2011, 9:17 pm

Bookmarklet to escape all &, <, \, [ and ] in any open Talk posting/editing windows.

javascript:(function(){for(var i=0; i<frames.length; i++){var e=frames[ ;i].document.getElementById('contribution'); e.value=e.value.replace(/\&/g, '&amp;') .replace(/\</g, '&lt;') .replace(/\[/g, '&#91;') .replace(/\]/g, '&#93;') .replace(/\\/g, '&#92;')}}())

29brightcopy
Mai 3, 2011, 10:16 pm

Bookmarklet to expand the maximum length of the tag edit box for combining tags

javascript:(function(){document.getElementById('totag').setAttribute('maxlength',1000)}())

30brightcopy
Modifié : Mai 7, 2011, 8:03 pm

LT Cover View Links

In cover view the covers do not have valid hrefs, so you can't middle-click on the links to open them in a new tab. Instead, they only have javascript onclick handlers to handle left-clicks. This script adds valid links so you can easily open the covers in other tabs.

See also: http://www.librarything.com/topic/88350

31brightcopy
Modifié : Mai 7, 2011, 8:03 pm

LT Large Change Cover Image

Sometimes you need to a see a larger picture of the cover you've chosen for various reasons. This script adds the largest size you can request from LibraryThing (200 pixels wide) and displays it in on the top-right of the cover images page.

32brightcopy
Mai 8, 2011, 12:14 pm

LibraryThing Firefox Cover Effect (Stylish Addon Script)

Adds an effect in Firefox for a work's cover on the work pages that matches the effect in Safari/Chrome. This effect is a white border with a drop shadow that zooms slightly larger on mouseover.

See also this thread.

33brightcopy
Modifié : Mai 9, 2011, 10:33 am

LT Copy Book - LibraryThing

This script adds buttons for "Add to library" and "Add to wishlist" onto every Book Detail screen. When clicked, these buttons copy data from the book currently on screen and take you to the manual entry page. Data from the previous screen is pasted into the fields on the manual entry screen.

Discuss this script here.



34DaynaRT
Mai 9, 2011, 9:19 am

>33 brightcopy:
You realize that last script wins you a Nobel Peace Prize, don't you?

35brightcopy
Mai 9, 2011, 9:59 am

34> I figured it might be popular. ;)

So far, I'm only posting it here. Curious to see how many people actually read this thread.

36justjim
Mai 9, 2011, 10:04 am

I do, and I'd like to add my thanks as well.

37brightcopy
Mai 9, 2011, 10:32 am

Well, that accounts for the 2 downloads. :D

I'm starting a new thread to discuss this particular script, just to avoid adding too many comments to this thread.

Here's the thread.

38lucien
Mai 9, 2011, 10:48 am

>34 DaynaRT:
Seems more like a shot across the bow than a peace gesture! ;)

39LolaWalser
Mai 10, 2011, 12:23 am

**starring thread**

That's just splendid. Too late for me, but I'll download it anyway.

40jjmcgaffey
Mai 10, 2011, 9:05 pm

Weird thing - this thread displays just a little too wide for me (FF3.6.17, Win XP). I'm using the floating left nav and groups list, and up to the first e in Message is under the nav. It might be the bookmarklets in 27 and 28. Hmmm, it's also a little wide in FF4.0.1 on Win7 - not as bad, I only lose the first part of the M in Message, so can see all the text. Anyone else seeing this?

41brightcopy
Mai 10, 2011, 9:20 pm

Nope, it's just you. And you're probably imagining it. In fact, if you hit refresh I bet it'd look just fine. ;)

Seriously, though, it's all my fault. :D

It's those long-ass blocks of unbroken javascript code I had above. Long unbroken lines don't play well with the floating nav bar. I had noticed it but figured I'd just suck it up since I caused it. I didn't think about the fact that some other people had used my floating nav bar modification and would be seeing it, too. So I went up and stuck some spaces in at various places so it would break. Should be better now. I wish userscripts had a space to add bookmarklets as well as gm scripts.

42jjmcgaffey
Mai 10, 2011, 11:20 pm

Thanks! Yes, that fixed it. Yeah, it would be handy to have a spot for bookmarklets.

43brightcopy
Modifié : Mai 27, 2011, 3:43 am

LT Auto Link Replies

Automatically adds a link to the message number and possibly username when clicking the Reply links in Talk. Also adds a Ref link under the More section. This allows additional references to be inserted into the message composition box.

Please direct all discussion of this script to here.

44brightcopy
Modifié : Mai 31, 2011, 12:50 am

LT Read Helper

Read Helper automates some common tasks to help with shuffling books between To Read, Currently Reading, Read and Read but Unowned collections. Additionally, it automatically sets start and end dates for the reading.

LT discussion thread here.

46brightcopy
Modifié : Juin 3, 2011, 12:28 am

Bold Unread Message Dates (Stylish script)

Bolds the dates on all unread messages in Talk

47brightcopy
Mar 9, 2012, 10:20 pm

LT Ratings Details Script

Adds Median, Mode(adj) and Members lines to the green Ratings box on work pages.

48brightcopy
Mai 15, 2012, 7:05 pm

Always Show Collections in Add Books (Stylish Script)

Always shows all collections on the left side of the Add Books screen.

49omargosh
Jan 25, 2014, 6:30 am

New GreaseMonkey script: Add 10 authors at a time

I made this script because, when I've added multiple contributors to an anthology, I've grown tired of clicking the "add another author" link, moving my mouse slightly down, clicking it again, moving mouse slightly down again, etc., etc. This script adds a link (on the "Edit your book" page) that replicates the click of "add another author" 10 times.

Any unused fields are discarded when the page is saved (no blank authors get added).



As always, if you have any questions or find any problems, please let me know. Thanks.

50Keeline
Jan 25, 2014, 8:51 am

#49 by omargosh>

This could be helpful. When I've done similar things I have sometimes wished for the following:

That the "add another author" or a similar link would set the role the same as the last one entered above the link. Hence, if it was set to "Contributor" then that would be repeated. It could be altered if necessary once added, of course.

James

51omargosh
Jan 25, 2014, 4:56 pm

#50 by Keeline>
Indeed. In fact, at first, I had hoped to make the "add another 10 authors" really be "add 10 contributors" but didn't (at least initially) see an easy way to do this. But sometimes I just need time for things to cook in the brain, so I'll take a look at it again and see if I can't make that happen. I realize it would especially be useful if the last one entered was a custom/"Other ..." role, though I'm currently cooking up a script to make one's own preferred custom roles appear in the dropdowns already.

52.Monkey.
Jan 25, 2014, 4:58 pm

>51 omargosh: Now that would really make my day!

53Keeline
Jan 25, 2014, 6:14 pm

#51 by omargosh>

That's another good improvement. I am constantly having to manually add other>>"pseud." and other>>"ghostwriter". To save time on the latter I am defaulting to "author" and accepting that in my personal catalog it is not 100% true (a ghostwriter ≠ author).

James

54omargosh
Jan 26, 2014, 1:26 am

I forgot to sound off this script here in Hacking LT:

Full title on work pages

Summary: On a work page, show the full, untruncated text of the work's title, instead of the default ellipsized behavior (for really long titles).

And a big thank you to brightcopy! This was my first ever GreaseMonkey script and he provided lots of helpful feedback and encouragement.

55brightcopy
Jan 26, 2014, 2:03 pm

Any time. I've been kind of out of LT lately (partially due to annoyance at site direction or lack thereof). Glad to see someone taking up the torch!

56SylviaC
Jan 27, 2014, 8:53 pm

54: When I click on the Install button for "Full title on work pages", it just takes me to a completely blank page. "Add 10 authors at a time" installed with no problem.

And thanks!

57KarenElissa
Jan 27, 2014, 9:04 pm

>56 SylviaC: I just had that problem too. Go to this page and click the install link for the latest version, for some reason that works.

58SylviaC
Jan 27, 2014, 9:57 pm

57: Thanks! That worked.

59omargosh
Fév 18, 2014, 10:23 am

Profile tab

Adds a "Profile" tab next to the "Home" tab, like the old LT used to have (I actually made this shortly after the redesign but don't think I advertised it in this group).

60omargosh
Fév 18, 2014, 10:26 am

More "editions" links (update)

This one's been updated to add the (editions) links to list pages, catalog pages, CK and helper logs, and awards/places/events pages.

61omargosh
Fév 18, 2014, 10:29 am

WorldCat direct links

Similar to the direct link for Amazon, uses the work's most popular ISBN to create a direct link to the book's page in WorldCat.

62omargosh
Fév 18, 2014, 10:36 am

Make author combining/nevering easier (advertisted in Combiners, but I don't think here yet)

This script moves the "Improve this author" box to the top, always shows "(never)" links, always shows the search box, prepopulates it with the author name, and does a few more things (full list and screenshot on script page).

63omargosh
Fév 18, 2014, 11:37 am

Make flagged cover voting page bearable

On http://www.librarything.com/helpers_covers.php, hide covers that you've already voted on, and make that ridiculously long line of pagination links wrap.

64JerryMmm
Fév 18, 2014, 3:14 pm

>61 omargosh: Could you add a direct worldcat link in the http://www.librarything.com/combine.php?author= page?

65omargosh
Fév 19, 2014, 1:41 am

#64 by JerryMmm> Is this what you had in mind?

Links to WorldCat on combination/separation pages

It uses ISBN if available for that edition, and otherwise does a search.

66omargosh
Mar 5, 2014, 1:24 am

Blurber author pages

For each of the blurbers listed on a work, this script creates a link to their author page (assuming it exists)

67JerryMmm
Mar 5, 2014, 2:11 pm

>65 omargosh:
yes, perfect.

68nandadevi
Oct 21, 2014, 11:17 pm

Note that the location where GreaseMonkey scripts were stored (and where the links on previous posts point to) has been closed down. These scripts, and links, previously pointed to userscripts.org. If you try to link to that location you MIGHT be taken to a mirror site, but the mirror site has very little of the functionality of the original site, and will not take you directly to the LibraryThing scripts. Manually navigating (there is no search function...) to the scripts could take days (browsing over 5000 pages)

HOWEVER, all the scripts previously stored in userscripts.org (including the librarything ones) are now available at http://www.webextender.net/index.html To get to the LT scripts from the webextender home page simply use 'librarything' as your search criteria.

I can't make any comment on whether any or all of these scripts are still functional. Although I believe Webextender holds 'uncorrupted' copies of the ones that were originally referenced from this discussion thread I wouldn't be surprised if changes made to LT over the years might not have caused some disruption/disjunction. Good luck, and immense credit to the folk that put them together in the first place.

69omargosh
Août 3, 2015, 5:42 pm

Which of my books tagged

Adds a link to any LibraryThing tag page that pops up a box showing any of your works that other users have applied that tag to, in the same way that the tag mirror page pops up a box with your works as others have popularly tagged them. The difference is that you can now see such information for any tag in the system, not just the ones that show up on your tag mirror or that you've tagged as such (without having to page through and search for green checkmarks).



Note the new "My books globally tagged ______" link.

70eromsted
Août 3, 2015, 5:49 pm

>69 omargosh:
Super-awesome. Thank you.

Any possibility of filtering out my uses of the tag? That would make it super-duper-awesome.

71omargosh
Août 3, 2015, 8:26 pm

>70 eromsted: Probably not. Or ... I think it might be kinda sorta maybe perhaps possible after spending lots more time learning the LT APIs and more JavaScript (maybe), but for now it will probably have to remain just super-awesome.

72eromsted
Août 3, 2015, 9:15 pm

71>
Ah well. I figured it wouldn't be trivial as the information needed is not on the page.

On another note, I seem to have found a bug. The script is working great on most tag pages I've checked. But a few have inexplicably come up with zero even when I can see check-marks on the first page of the list. Examples so far are Weimar Republic, Welsh, Wessex. The Ws don't mean anything. That's just where I am in the alphabet looking up potential combinations for my tags.

73omargosh
Août 4, 2015, 10:33 am

>72 eromsted: Sorry about that bug. I've posted a new version of the script at the same place (https://greasyfork.org/en/scripts/11311-librarything-which-of-my-books-tagged) that I think should work for those tags. Hopefully all should work better now. Let me know if you find other problems. Thanks!

74eromsted
Modifié : Août 4, 2015, 10:40 pm

>73 omargosh:
Thank you. I'd collected some more examples since I posted and your new version fixed those as well.

75omargosh
Mai 23, 2016, 2:14 pm

This one's not an LT-related script, but still book-related, so I thought some here might be interested.

Amazon Wishlist Export

Adds a button on one's wish list pages to save a local copy of the list as a .tsv file.

76omargosh
Mai 29, 2016, 11:01 am

As requested here:

Ignore articles/punctuation on combine page

This script changes the sort order of works on the "Combine/separation" pages of LibraryThing to ignore words like A, An, The, etc., at the beginning of work titles. Default is English, but you can add others as you see fit (and they'll stick around).

Notice that with German articles added into the new input box, Die Canterbury Schwestern and The Canterbury Sisters now sort by C instead of D and T. You can also use this temporarily to ignore parts of the title where an author's works are often prefixed. For example, adding "Blake" and "William Blake" to the input field results in the first entries sorting by numbers instead:

Bonus: It also ignores punctuation. Caveat: It currently doesn't work for compound articles such as L' (just those with a space after them).

77macsbrains
Mai 29, 2016, 11:27 pm

>76 omargosh: This is great!

78davidgn
Mai 30, 2016, 12:24 am

>76 omargosh: Loving it, thanks!

79omargosh
Août 4, 2016, 9:33 pm

(Apparently I lied about not having any time to dedicate to making userscripts)

Alphabetize book tags

Displays your books' tags in alphabetical order and also saves them in alphabetical order (if you make an edit to the existing tags, or edit and save anything on the "Edit book" page).



Warning: Don't use this script if you want to preserve a non-alphabetical ordering scheme you currently have in place.

Let me know if you run into issues or if there are places I just forgot to apply it.

80SylviaC
Août 5, 2016, 12:29 am

>79 omargosh: Wow, that's awesome! I'll have to try it when I get on the other computer. I missed tag alphabetization when it was taken away, and have given up on trying to get it back.

81aethercowboy
Août 5, 2016, 11:15 am

I made this a little while ago, but never posted it:

https://github.com/aethercowboy/LibraryThing.WebServices

A .NET implementation of the LibraryThing WebServices API.

Beta, of course.