FujoWebDev / AO3.js

NodeJS API for scraping AO3 data
MIT License
15 stars 8 forks source link

Add series and collection types #50

Open riazaia opened 1 year ago

riazaia commented 1 year ago

Finally making this PR based on previous discussions. I made a couple of judgement calls but feel free to comment on those or anything else you disagree with.

todo

riazaia commented 1 year ago

I was looking through the rest of the code and we use collectionName when grabbing it from a url of the shape: https://archiveofourown.org/collections/YJ_Prompts/works/30216801 where in this case the variable's value would be YJ_Prompts so maybe I'll change the id property back to name?

Though I'm also the one that came up with that variable name so that just be my bias talking and other's do prefer id to refer to a collection's unique identifier.

Pls giv thoughts!

essential-randomness commented 1 year ago

So, taken a look at collection here: https://archiveofourown.org/collections/YJ_Prompts

There's a different semantic between id and name. An id is a (usually unique) identifier, often for the use of software more than people. name is generally what you'd display in a UI for people to read.

In this case, I would say YJ_Prompts is the id of the collection, and Young Justice Prompt Meme its name.

riazaia commented 1 year ago

In this case, I would say YJ_Prompts is the id of the collection, and Young Justice Prompt Meme its name.

@essential-randomness Yes, though interestingly and annoyingly, in the UI when you create the collection those are called 'Collection name' and 'Display title' respectively...

image

essential-randomness commented 1 year ago

image

essential-randomness commented 1 year ago

Ok, jokes aside, if there is any e.g. numerical id that AO3 refers to the collection with, then that should be the id. But my understanding is that the id used to identify the collection is indeed what they call "name" in their UI.

We could rename name to title though.

enigmalea commented 1 year ago

[Edited because Ria came to my defense.... LOL]

There's no numerical value that's exposed for id that I'm aware of. The collection name is used to identify the collection and must be unique. The display title can be anything.

I'm still leaning toward no id, collectionName, and displayTitle, if only because the people who are going to want to scrape the collections are the people who are most likely creating them, and we should try to match the terminology they're used to.