lucyschrader / randomCO

Use Te Papa's API to randomly display an image from the collections

Home Page:https://random-co.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get a random image from Te Papa

This is a Python application that serves up an image from Te Papa's collections. And then another one. And another. And again...

It uses Te Papa's API, the askCO package, and Flask.

Installation

Clone this repo. In a virtual environment import the askCO and Flask packages. This should give you requests too, but doublecheck.

Register for an API key save it as an environment variable called TPAK-RANDOM.

In app.py you can set a few config parameters. I recommend keeping max_records at 1000 while you're testing it out, as a full object harvest takes a while.

In random.js you can set the refresh rate – by default this is 15 seconds.

About

Use Te Papa's API to randomly display an image from the collections

https://random-co.vercel.app


Languages

Language:Python 47.1%Language:HTML 33.6%Language:CSS 12.9%Language:JavaScript 6.3%