Code Monkey home page Code Monkey logo

ao3-podfic-posting-helper's Introduction

AO3 Podfic Posting Helper

CircleCI

Logo: A platypus holding a microphone in front of the letters AO3

When you post a new work, this extension can help you by importing metadata such as tags and rating to match the work that inspired you.

This is an unofficial extension and not supported by AO3. Please do not raise issues with this extension to AO3 support.

Available on the Chrome Web Store

Available as a Firefox Add-on

Available as a Microsoft Edge Extension

You can configure it to:

  • Automatically add the "Podfic" tag
  • Automatically add a "Podfic Length: X" tag
  • Apply a transformation to the original title, such as adding the prefix "[Podfic] "
  • Apply a transformation to the original summary, such as wrapping it in a blockquote and linking to that work and its authors

A popup over the new work page, showing the options available to configure importing metadata

If the default set of title transformations isn't enough, you can configure a custom format on the options page. "${title}" will be replaced with the original title and "${authors}" with the original authors.

For example, if the original work is called "Super awesome title" and is by "author1" and "author2":

  • "${title}" will give you "Super awesome title"
  • "[Podfic] ${title}" will give you "[Podfic] Super awesome title"
  • "podfic of ${title} by ${authors}" will give you "podfic of Super awesome title by author1, author2"

An options page where you can configure a custom title transformation

If the default set of summary transformations isn't enough, you can configure a custom format on the options page. The following replacements will be made:

  • ${blocksummary}: The summary of the original work wrapped in a blockquote. Because of the way ao3 handles block quotes, you should put whatever you want to follow this on the same line.
  • ${summary}:The summary of the original work.
  • ${title}: The title of the original work. This will be a link to the original work.
  • ${authors}: A comma-separated list of the authors of the original work. Each author is a link to their AO3 page.

An options page where you can configure a custom summary transformation

You can also configure a custom default body for your work, instead of a default which demonstrates how to embed audio, images, or links.

An options page where you can configure the default body of your new work

Documentation

A lot of the basic structure of this app (popup page/option page/background loader) was built directly on the Chrome extension getting started tutorial.

popup.js

The core importing logic that gets the metadata from the original work, and the filling logic, to enter it into AO3's new work form. There's also some logic here to save pop-up options when a user hits import, so that they'll be the same next time.

Storing options

The only way to pass information between the form fields in the pop-up and the injected html that fills in the "new work" form is to write it to storage and then read it back. That's what the browser.storage.sync.set/get calls do.

Code design

The pop-up and options page are built using Material Design Components for Web. We are using the web components without a framework and with barebones CSS. The JS and CSS files for the components were downloaded from CDN and are packed in source here. We didn't set up any kind of package management with Node or any bundling with tools like Webpack on account of these being more effort than we were willing to invest right now. Code is organized as ES6 modules where possible.

ao3-podfic-posting-helper's People

Contributors

dependabot[bot] avatar irrationalpie7 avatar jdm avatar jermowery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ao3-podfic-posting-helper's Issues

Allow templating the Podfic title

From a user request:

At the moment I'm changing this manually, but would it be possible to implement another standard title format? I know some people do 'podfic of' or some variation. For myself, I just want the p in [Podfic] to be lowercase, which is an easy change. I'm just curious because I find this extension so well built and helpful thus far.

Add ability to specify additional work tags

Some people like to use an audio format tag like "Audio Format: MP3". Technically this could be done as another dropdown like the length one, but if we consider only canonical audio format tags we won't include "Audio Format: Download", which at 590 uses is more widely used than the canonical tag "Audio Format: M4A" ‎(325). Also, it's a little trickier because e.g. "Audio Format: Streaming" and "Audio Format: MP3" aren't mutually exclusive, so a lot of people will use both (14061 works as of right now, apparently.

Technically the audio format tags were the only ones specifically requested by the extension users I talked to, beyond a misunderstanding about the "Podfic & Podficced Works" tag, but I'm also wondering if simply allowing a free-form comma-separated list of custom tags would also help for the non-podfic use case, where someone wants to make filling in metadata easier by pulling from a similar work, but might be posting fanfiction or fanart rather than a podfic. They wouldn't need the "Podfic" or "Podfic Length: X" tags, but might want something else instead, like "Fanart".

Allow more permissive import url validation

As long as the URL is from ao3 and has "/works/[0-9]+" in it, if it's valid I'm pretty sure it'll be pointing at a work page. Relaxing validation will be useful for people just pasting in a url, because depending how you got to the page it may have some url parameters (view adult, or view full work) or end in "#someid" (in particular the previous/next chapter buttons on ao3 will send you to a link like this). This new matching scheme would accept all currently accepted urls. I don't know if we'd want to say trim trailing spaces? But also work urls shouldn't have spaces in them, so we could just have the final regex be something like "<ao3 base>/(.*/)?works/[0-9]+[^ ]*" to make sure there aren't trailing spaces

*Can't remember right now is it's supposed to be "works" or "work", but same dealio either way

Add end notes template

A request that came in today from gee_dee:
"My only remaining wish is that I could fill in a template for end notes, but I'm guessing that's not possible? Other than that, THANK YOU SO MUCH bc it really is an incredible time saver!!!"

Thoughts:
Pop-up's getting a little crowded (my laptop screen is so small 😭) so we'd need to think how we present this to people if we decide to add it, and whether we let people pick whether they want notes to be at the beginning or end or offer both, but on the implementation side the template replacement would work similar to the summary

Importing from gifted work should not credit the gift recipient

User reported bug:

Hi! I love this extension and I use it CONSTANTLY, thank you for creating it. I noticed something last night that I thought I should let you know about. I imported a work that had been a gift work to someone else, and both the author's name and the recipient's name were imported into the new summary so that my new work summary read 'podfic of [title] by [author],[gift recipient]'. I have now removed the giftee's name from my summary, since they didn't write the thing, but I thought you should know.

Add navigation side bar to the options page

The options page is getting kind of long, so I think it would be helpful to have a sidebar that highlights what section you're scrolled to/lets you jump to a specific other section

Support a "copy tags only" mode

From a user request:

This is a bit of a long shot and isn’t part of the exact focus of the extension, but I’ve found the extension to be really helpful for posting a lot of similar drabbles (put a previous post as the source, to copy all the meta, then removing the podfic-specific elements and changing the title and summary). So a potential wish list item would be a checkbox to “copy tags only” (i.e. rating, warnings, fandom, tags, and the body html autofill). Again, totally realize this is out of scope but it’s been an interesting use case.

[Popup]: Work template strips iframe tag

The preview complains that <iframe src="https://archive.org/embed/litany_202209/litany.mp3" height="30" width="500"></iframe> isn't supported by AO3, but all my podfic works use it.

Allow importing from a series

Allow users to import from a series URL, importing tags (in the various categories such as fandom, relationship, etc) from all the works in that series.

Some things to consider:

  • Some metadata (e.g. language and rating) are only allowed to have one value, but within a series might have multiple values. For rating, AO3 picks and shows the max (not sure how unrated works influence this). I'm not sure what to do about language--I guess we could just leave it blank if not everything in the series is the same, and then ao3 would complain when the user tried to save the work if they didn't pick anything themselves
  • Pulling this info from each individual work in the series by going to its work page (which we already know how to parse) would quickly run into AO3's rate-limiting, so we should not do that
  • The dom on a series page does seem to mark up the different kinds of tags with what category they belong to (e.g. character, freeform)
  • Some info is only available on the works page, as far as I know (e.g., AO3 shows at most one "category" tag per work on a series page--F/F, M/M, Gen, Multi, etc)
  • There's limits to the number of tags per work, that do not apply to tags for a series as a whole. If you go over the limit when trying to post a new work, AO3 won't let you save your draft until you're back under the limit. If there's a lot of tags, it could be very annoying to the user to manually get rid of the extras. Possibly we could show users an extra warning if they're going over the limit and tell them by how much?
  • AO3 (a) doesn't allow you to set a series as the work that inspired you and (b) only lets you add one inspirational work per time you submit the new work form. I suggest listing the first work in the series as an inspiration and calling it a day

Allow importing from urls with chapter ids but no work ids

Today I learned that you can omit works/(id)/ from the works/(id)/chapters/(id) portion of a chaptered work url. Since the resulting page still has all the metadata and such on it, and at least looks the same so hopefully is the same, we should be able to just add this as a supported format to the url regex.

Here's an example of such a url: https://archiveofourown.org/chapters/70248750 (the page it points to looks visually identical to https://archiveofourown.org/works/28656861/chapters/70248750 to me)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.