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

leagueofcomicgeeks

v1.1.0

Published

Unofficial Node.js library for interacting with League of Comic Geeks

Downloads

14

Readme

leagueofcomicgeeks

Greenkeeper badge npm version Build Status Dependencies Status

Unofficial Node.js library for interacting with League of Comic Geeks. This provides an API for any system wishing to interact with an account on League of Comic Geeks and supports authentication and all lists. It has a comprehensive integration test setup to detect when the site makes breaking changes. Please create an issue or (better yet) a pull request if you see a problem or need additional features!


Resources

  1. Session
  2. New Comics
  3. Search Results
  4. Collection
  5. Read List
  6. Wish List
  7. Pull List

All methods on resources are asynchronous and follow the nodejs "error-first callback" pattern. For use with promises, consider using something like Bluebird's promisification functions.

There are examples on using the different resources in the examples directory.

Session

Methods on the session object:

  • .create - Create a new session using the provided username and password. This sets up the session for all subsequent calls.
  • .validate - Validate that the active session is still valid.
  • .destroy - Destroy the current session both locally and on the site.
  • .get - Get the active session object.
  • .set - Set a previously retrieved session object.

Used to log in and out of the application. You can get the current session object for saving, as well as set the current session by setting a previously retrieved session object. The active session can then be validated to confirm it's working.

Lists

Calls to get list data all follow a standard format:

list.get(identifier, options, callback);

Where the identifier can be an issue id, series id, search term, pull list date, etc. depending on the list being accessed.

The options parameter is optional, but is used to specify the type returned (eg. "series" or "issue") and for any sorting or filtering.

Options support:

  • type - "series" or "issue". Defaults to "issue".
    • Use the lofcg.types helper for getting type values, eg. lofcg.types.ISSUE
  • publishers - an array of publisher names to filter on. Defaults to no filtering.
  • sort - "asc" (ascending) or "desc" (descending). Defaults to "asc".
    • Note: Sorting is performed within the module on the response from the server (ie. not by the server itself) due to sorting bugs in the endpoints. However, the server provides additional sorting options depending on the list. Passing a value which is not one of the two supported will be delegated to the server (eg. providing "pulls" for Most Pulled on Pull List will have that order provided by the server).
const lofcg = require('leagueofcomicgeeks');
const options = {
  type: lofcg.types.SERIES,
  publishers: ['Marvel Comics', 'DC Comics', 'Other'],
  sort: 'desc'
}
lofcg.searchResults.get('detective', options, function (err, results) {
   // ...
});

The exception to this is the Pull List, which also requires a date:

const lofcg = require('leagueofcomicgeeks');
const myUserId = 26853; // alistairjcbrown
lofcg.pullList.get(myUserId, '2017-03-29', function (err, pullList) {
  // ...
});

Again, additional examples can be found in the examples directory.

Read-only Lists

Methods on read-only lists:

  • .get - Get a list of comic issues or series for a user

New Comics and Search Results are read-only lists - you can only get data from them, you cannot update them.

User Lists

Methods on user lists:

  • .get - Get a list of comic issues or series for a user
  • .add - Add a comic issue or series to my list
  • .remove - Add a comic issue or series to my list

Note: .add and .remove require you to be authenticated. .get does not and can be called on any user.


To do

  • Tests

    • [ ] Unit tests
    • [ ] Travid integration
      • [x] Periodic run for integration tests
      • [ ] PR run for unit tests
  • Additional functionality

    • [x] Sorting - A-Z, Z-A
      • [x] Pull lists can have "most pulled"
    • List of subscriptions from /profile/alistairjcbrown/pull-list-subscriptions
    • [ ] Format selection - issues, annuals, digital, reprints, trade paperbacks, etc.
    • [ ] Filtering - owned, not owned, read, not read
      • [ ] New comics can have "only #1s"
  • Get publishers list in / update it periodically?

    • [ ] Perhaps a publisher module which can be called to get latest, which by default falls back to JSON file
    • [ ] Without coupling the code, can we use the session check to get the updated list of providers?

Who am I?

Just a comic fan and someone who wanted to build on top of the awesome system in place at League of Comic Geeks.

You can see my profile here: https://leagueofcomicgeeks.com/profile/alistairjcbrown