npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ao3scraper

v1.3.1

Published

Simple package for scraping data from AO3

Downloads

1,893

Readme

ao3scraper

GitHub license GitHub issues

Simple node.js package for grabbing data from The Archive Of Our Own (AO3)


Installation

npm i ao3scraper

Usage

Standard usage is as a promise, as seen below:

const ao3scraper = require('ao3scraper')
//replace with your fic, this is just for demo
const pageURL = "https://archiveofourown.org/works/35864404"

ao3scraper(pageURL).then(ficInfo => {
    //do something with results
}).catch(err => {
    // This code block will also execute if the link is a 404
    console.error(err)
});

This will return an object:

{
  sfw: true, //if the fic is safe for work as bool
  title: 'Cookies and Deceit', //work title as string
  authors: [ 'dpdog' ], //authors as array of strings (even if only one)
  summary: 'They’d messed up, but they’d make it right.', //summary as string
  tags: [
    'Fluff',
    'Identity Reveal',
    'Mentioned Lila Rossi',
    'Not Beta Read'
  ], //freeform tags as array of strings
  chapters: '1/1', //chapters as string
  published: '2021-12-22', //publish date as string
  updated: undefined, //update date as string 
  wordCount: 2086, //word count as integer
  commentCount: 2, //comment count as integer
  kudosCount: 80, //kudos count as integer
  bookmarkCount: 9, //bookmark count as integer
  hitCount: 904, //hit count as integer
  rating: 'General Audiences', //rating as string
  pairings: [
    'Alya Césaire & Marinette Dupain-Cheng | Ladybug',
    'Adrien Agreste | Chat Noir/Marinette Dupain-Cheng | Ladybug'
  ], //relationships as array of strings
  category: [ 'F/M', 'Gen' ], //categories as array of strings
  language: 'English', //language as string
  warnings: [ 'No Archive Warnings Apply' ], //warnings as array of strings
  authorPages: [ '/users/dpdog/pseuds/dpdog' ], //links to authors userpages as array of strings
  fandoms: [ 'Miraculous Ladybug' ], //fandoms as array of strings
  collections: [ 'Challenge of the Day' ] //collections as array of strings
}

This data will be returned regardless of the fic rating.