niezam / stonks

An epaper display that scrapes the internet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YouTube Channel Views

Audrey: Quiet bringer of the internets.

A little 6 inch e-paper screen that connects to wifi and runs a script that pulls the stuff that you've told it you're intersted in, then displays it in pleasingly crispy fonts. The script randomly chooses from 5 options:

  • Quote (from r/quotes)
  • Word of the Day (from wordsmith.org)
  • Headline (From The Guardian) (With QR code link to the article)
  • Cartoon (From The New Yorker)
  • Cryptocurrency Dashboard

Quotes

This is a script that parses content from r/quotes and tidies it up a little to make an ever-changing Quote poster, using content from the hive-mind that is the internet.

The quote is then displayed on the attached Waveshare 6inch HD ePaper.

The reason for using r/quotes rather than a curated database, is that the karma score on reddit is a really good way to ensure quotes that are interesting and topical.

The quality of the results depends on the adherence to convention in posts to r/quotes and the quality of the regex in the script. Currently the script is rarely producing garbled quotes, so it's ready for sharing.

As well as producing quotes, the script occasionally places other content on the epaper - to keep things interesting.

Cryptocurrency Dashboard

Uses code based on the stuff at btcticker. The extra screen size means that three (or four) coins can fit on the screen at once. There is also a maximal mode that will show one coin and an item from and RSS news feed, and a QR code link to that article.

Prerequisites

  • A working Pi with waveshare 6inch HD ePaper attached
  • The Python module for IT8951 installed

Installation

Get up-to-date with

sudo apt-get update
sudo apt-get upgrade

then, enable spi and clone this repository using

sudo raspi-config nonint do_spi 0
git clone https://github.com/llvllch/stonks

then:

cd stonks

Install the required modules using pip:

python3 -m pip install -r requirements.txt

Run the code using:

python3 crypotick.py

To periodically run the script, set it as a cronjob or systemd. Systemd gives better control over restarts etc when the internet isn't playing nicely

Configuration

Edit the file config.yaml. There are boolean values for activation of modes, as well as a function section that lists the functions that are sampled on for each refresh iteration. There is also a weighting of those samples.

function: 
  mode: crypto,redditquotes, wordaday, newyorkercartoon, guardianheadlines
  weight: 40, 1, 0, 0,1  

Means that on each iteration there is a 40/1/1 weighting that the code will choose the functions crypto, redditquotes and guardianheadlines respectively.

Add Autostart

cat <<EOF | sudo tee /etc/systemd/system/btcticker.service
[Unit]
Description=btcticker
After=network.target

[Service]
ExecStart=/usr/bin/python3 -u /home/pi/stonks/cryptotick.py
WorkingDirectory=/home/pi/stonks/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi

[Install]
WantedBy=multi-user.target
EOF

Now, simply enable the service you just made and reboot

sudo systemctl enable btcticker.service
sudo systemctl start btcticker.service

sudo reboot

Video

video

Hardware

  • The code runs on a Rasperry Pi connected to a 6 inch HD waveshare epaper display
  • The fancypants frame was custom made for the project - we've got some assembled ones for sale at veeb.ch

Contributing

To contribute, please fork the repository and use a feature branch. Pull requests are welcome.

Licencing

GNU GENERAL PUBLIC LICENSE Version 3.0

About

An epaper display that scrapes the internet

License:GNU General Public License v3.0


Languages

Language:Python 100.0%