Giter VIP home page Giter VIP logo

discogs-influxdb's Introduction

Discogs InfluxDB

Go Report

Export price data from Discogs listings to InfluxDB

Screenshot of data in Grafana

Table of Contents

Background

I wanted a way to visually track the prices of expensive records in Grafana but Telegraf and Discogs API had no way of working together. So I created this small tool written in Go to pull prices from Discogs API (using a fork of go-discogs) and push them to InfluxDB using influxdbv2 client.

The fork of is locally embedded in the project because the changes for Discogs' Marketplace API are not available in upstream.

Install

From releases

Download one of the releases from the Releases page.

Building with Go

You can very easily build the binaries yourself. A Makefile is included for easier building for all different platforms:

# This will build ARM and x64
$ make build

# This will simply build using the standard go toolchain
$ go build .

Usage

Config file

You will need to create a config.toml file with your credentials for InfluxDB and Discogs. By default, discogs-influxb will look in its own directory for a config.toml file, but an alternative path can be provided using --config <path>

A sample config file is included in config.sample.toml. Edit that one with your correct credentials and rename it to config.toml

CLI

You can invoke the binary to just trigger a one time push to InfluxDB.

Systemd

A sample systemd service and a timer are included to run discogs-influxdb at regular intervals. Copy the files for systemd over to /etc/systemd/system/ and then copy the binary and config file for discogs-influxdb over to /opt/discogs-influxdb (or change the path in the systemd service), afterwards reload and restart:

$ cp discogs-influxdb.service /etc/system/systemd/
$ cp discogs-influxdb.timer /etc/system/systemd/
$ systemctl daemon-reload
$ systemctl enable discogs-influxdb.timer
$ systemctl start discogs-influxdb.service

Others

pm2, cronjobs, docker, bash script...

API

  • --config <path>, path to the config.toml file to use
  • --verbose, show verbose output

License

MIT

For more info, see license file

discogs-influxdb's People

Contributors

pre-commit-ci[bot] avatar thibmaek avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.