Git Product home page Git Product logo

print-list-of-books's Introduction

Generate a printable list of books

This repo contains two Node.js scripts intended to make it easy to print out a list of books.

Get a list of books

node get_nyt_bestsellers.js <listname> <outfile.json> <API Key>

This script grabs information on the given New York Times Bestseller list.

  • listname can be one of the available bestseller lists:
    • combined-print-and-e-book-fiction
    • combined-print-and-e-book-nonfiction
    • hardcover-fiction
    • hardcover-nonfiction
    • trade-fiction-paperback
    • paperback-nonfiction
    • advice-how-to-and-miscellaneous
    • childrens-middle-grade-hardcover
    • picture-books
    • series-books
    • young-adult-hardcover
    • audio-fiction
    • audio-nonfiction
    • business-books
    • graphic-books-and-manga
    • mass-market-monthly
    • middle-grade-paperback-monthly
    • young-adult-paperback-monthly
  • outfile.json is the name of the JSON file to output book details to. It can be read by the generate_pdf_from_booklist.js script.
  • API Key is the key for the New York Times Books API. See documentation on getting an API key.

The output JSON file contains title, subtitle, description, author, and thumbnail image link for each book in the bestseller list.

Print a list of books

node generate_pdf_from_booklist.js <books.json> <outfile.pdf>

This script generates a printable PDF from the book list output by the previous script.

  • books.json is the path to a JSON file listing books. It requires the following fields: title, author, thumbnail. subtitle and description are optional. It can be generated from the previous script.
  • outfile.pdf path to where the generated PDF file should be saved.

The PDF is generated using the included template.html file. It is intended to be printed duplex. Edit it to change the styling. Edit the #titlepage element to add a front cover, or delete it for no front cover.

print-list-of-books's People

Contributors

anniesullie avatar

Watchers

 avatar

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.