Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Latest commit

 

History

History
90 lines (57 loc) · 2.24 KB

README.md

File metadata and controls

90 lines (57 loc) · 2.24 KB

Spass mit Daten

Update: Diese Version ist obsolet. Das eingesetzte Tool "Nanogen" war nicht flexibel genug.
Neuer Sourcecode @ https://github.com/tomsrocket/spassmitdaten


Dieses Repository enthält den Code für die Open Data Linkliste auf spassmitdaten.de.

Copyright Infos

Setup

If you want to have screenshots of pdf files, you need to install imagemagick

sudo snap install imagemagick

Install

  1. Copy your credential files to the config directory
  2. Execute the following commands:
    npm install googleapis@27 --save

    node read-google-spreadsheet.js
  1. The links will be written to public/links.json

Generate screenshot thumbnail previews

    # generate all missing previews
    npm run generate-previews

That command ^ does the following things:

  1. Generate screenshots of all websites via: npx phantomjs generate-website-previews.js
  2. Optimize the screenshot images to width 480px via: node generate-thumbnails.js
  3. Download pdf files and create screenshots of the first page

Debugging

If it does not work, try running it with debugging enabled

DEBUG='*' node generate-website-previews.js 

Development

The following command builds the files in watch mode and serves the result at localhost:3000

    npx nanogen start 

Prod build

    # Build for prod
    npm run build

    # Serve static files
    cd public;sudo docker run -d -v `pwd -P`:/var/www:ro -p 8080:8080 trinitronx/python-simplehttpserver

Ideensammlung / Todos

Static Site generation with nanogen

Read full documentation about nanogen here: https://doug2k1.github.io/nanogen/docs/

    npx nanogen init

Start the current site:

$ npx nanogen start [options]

Build the current site:

$ nanogen build [options]