AO3 Bookmark Maker (Adds title, author, workID, summary to bookmark notes automatically)

Automatically adds the fic info (title, author, series/workID, and summary) to the bookmark notes while preserving any existing notes. It also adds word count tags or a "WIP" tag. Automatically sets all new bookmarks to default to being private as well. Great for tracking bookmarks. Helpful for re-readers! Or to figure out what that deleted fic used to be! (Note this is included in my AO3 Re-read Savior script)

< Feedback on AO3 Bookmark Maker (Adds title, author, workID, summary to bookmark notes automatically)

Review: Good - script works

§
Posted: 11-05-2023

Works! downloaded it for my ipad. note for anyone else who does the same, it does NOT work if you use the typical userscripts extension app. Instead, I downloaded Stay - Userscripts Extension which is a “Tampermonkey for Safari” thing, and that works well. I don’t know why that works but I’m happy.

It might be nice to have an extension that hides bookmark notes (but not tags) with a button to expand them if you choose since it naturally doubles up a lot of information and takes a lot of extra space when you’re just scrolling through your bookmarks normally.

§
Posted: 17-05-2023
Edited: 17-05-2023

I figured out why it wasn’t working, or only working occasionally for me.

the first thing is that I had to change the @match to @include at the start of the program. then it worked on userscripts for me, so I didn’t need the second extension manager.

The other thing is that it only works if you are bookmarking from a page with a summary on it. in hindsight this is obvious, but I’m a tad thick lol.

I also made some aesthetic adjustments, and I will include the code here just in case anyone else wants to do something similar.

// ADD TO VARIABLES var relationship; var workid;

// new summary statement gets text only, no formatting, and removes the Summary: label summary = document.getElementsByClassName("summary")[0].innerText.substring(10, document.getElementsByClassName("summary")[0].innerText.length)

// get relationship and work id, which can then be used in an archiveofourown.org/work/SOMENUMBER link to find in an internet archive relationship = document.getElementsByClassName("relationship tags")[1].innerText; workid = window.location.href.split("/")[4];

// put the bookmark html together with nice formatting. image attached of some random work bookmarked in this way. var newBookmarkNotes = "<b>" + title + "</b> by " + author + "<br><br> <i>" + relationship + "</i> <blockquote>" + summary + "</blockquote> <br> Work ID: " + workid + "<br><br>" + bookmarkNotes;

elli-lili-lunchTác giả
§
Posted: 08-07-2023

Hi hi! Thank you for the feedback and suggestions, especially how to get the work ID. I'm updating this script with workID functionality, as well as some other functionality based on any existing bookmark notes.

Weird about the @match vs @include, but the script editor keeps warning me about @include possibly losing functionality in 2023, so I'm leaving it as @match, but adding a comment next to it to let future users know @include may work for them!

§
Posted: 12-07-2023

The @match patterns may not be working for oliver as the ones currently in the script do not follow the @match syntax which is defined by Google/Chrome as follows (the developer.chrome.com link has more info on what can go where):

<url-pattern> := <scheme>://<host><path>
<scheme> := '*' | 'http' | 'https' | 'file' | 'ftp' | 'urn'
<host> := '*' | '*.' <any char except '/' and '*'>+
<path> := '/' <any chars>

In this case, the proper syntax for the two @match patterns would be:

// @match   *://archiveofourown.org/works/*
// @match   *://archiveofourown.org/series/*

However, there's a chance that the userscript app that oliver initially mentioned does not support wildcards in the <scheme> area—the only iOS app I've found that's just called "Userscripts" is this one and they mention that the extension "only supports http/s". So to cover all your bases the @match patterns would have to be:

// @match   http://archiveofourown.org/works/*
// @match   http://archiveofourown.org/series/*
// @match   https://archiveofourown.org/works/*
// @match   https://archiveofourown.org/series/*

Ideally, I'd like oliver or someone else on iOS to test out the match patterns but in the end it's 2 extra lines in the script if you want to play it safe and I don't think that's gonna be much of an issue w/ regards to filesize.

N.B: As far as I know, AO3 does not have any subdomains that it serves content on, so I've elected to not include subdomain matching here via adding a *. before the hostname part of the URL (e.g. https://*.archiveofourown.org/works/*) but you're free to do so if you'd like.


Hope this helps!

elli-lili-lunchTác giả
§
Posted: 15-07-2023
Edited: 15-07-2023
It might be nice to have an extension that hides bookmark notes (but not tags) with a button to expand them if you choose since it naturally doubles up a lot of information and takes a lot of extra space when you’re just scrolling through your bookmarks normally.

@oliver t - I'm going to update this script with this capability soon, but if you've already got your own modified script, w4tchdoge found that < details > (see here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) and < summary > (see here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary) to work!

Post reply

Đăng nhập để bình luận