Oct. 3rd, 2011
Scripts for Pinboard
Oct. 3rd, 2011 06:07 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
- Pinboard - Date Lines: Adds a date line between different dates on pinboard.in.
( Preview ) - Pinboard - Tag Frequency Autocomplete: So after renaming all my tags to have prefixes, I have to type a bunch more in the tags field before I get a good autocomplete match. Plus, the Pinboard autocomplete sorts the matches alphabetically, not by which tags I use the most, so then I have to type even more. Obviously, this just won't do.
This rather experimental script works on the Pinboard add page, which is the one used by the posting bookmarklets. It hides the default autocomplete drop down and adds in a custom autocomplete widget that sorts the tags by frequency of use. Sadly, there is no easily accessible source of tag frequency data, so I had to take the HTML that makes up the tag list on your account page, and parse out the various font sizes to decide which tags get used most often. It makes for a very rough guide to tag frequency, but so far I'm finding it better than alphabetical. Your mileage may vary significantly.
( Preview ) - Pinboard - Sort Visible Links: I ported my Delicious sorting script over to Pinboard, so that you can sort all the links on the page by their title, URL or popularity. Should be compatible with the very handy Greasemonkey script AutoPagerize. Keep in mind, though, that on Pinboard you must be logged in to see link popularity.
So far, I've tested it on quite a few pages, but if you find a page where it seems to exhibit irregular behaviour (like putting the sorting links in a weird place on the page, or moving the bottom pagination links to the top of the bookmark list, etc) please let me know!
(I'm also a little worried about the fragility of the Pinboard version. Pinboard doesn't use many id or class attributes in its HTML, which means that it is hard to script for. For example in this script, each bookmark div can sometimes -- but not always -- be contained within another div that has no id or class or any distinguishing feature whatsoever. The script has to jump through a few hoops to compensate, and if the page HTML changes a bit in future, that hoop jumping will probably not be successful. Basically, this script could break really easily anytime the site HTML gets updated, so please let me know if it suddenly stops working properly.)
( Preview ) - Pinboard - Slash Tag Emboldener: Makes tags that have forward slashes in them stand out better in Pinboard.
If you're using Stylish or a userscipt to change the look of Pinboard, you should be able to make the slash tags fit in with your style by adding a line like this to your custom code:
a.gm_slash_tag { color: #800800!important; }
#800800 is maroon -- replace it with whatever colour code suits your colour scheme.
( Preview ) - Pinboard - URL Cleaner: On the /add page (ie: the bookmarklet), highlights URLs with form params and anchors, and inserts a link that, when clicked, strips them out.
Mostly I use this one to strip out style=mine, mode=reply, etc. because I like to bookmark only clean links. Not useful for kinkmeme threads, but still handy for many LJ and DW links.
( Preview ) - Pinboard - Organize Taglist in Posting Page: On the posting page that shows your tags, divides the tags up alphabetically. Adds a list of letters above the taglist which can be used to jump to different sections of the list. Thanks to
christycorr for suggesting this script and testing it.
( Preview )
( Firefox Installation Instructions )
If you think the Pinboard UI should be tweaked in some way, let me know and maybe I will be tempted to make a script for you. And don't forget that lots of colour/font-size/etc changes can be done just with CSS and the Stylish extension for Firefox, as
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
I also did a quick set of instructions for making a userstyle that turns Pinboard visited bookmark links a lighter blue, so that they stand out more from the dark blue unvisited links. If you're interested in making simple CSS changes to Pinboard but don't know where to start, check out either the Firefox steps or the Chrome steps.