Giter Site home page Giter Site logo

cyberdelica / sp Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 6 KB

Fetches the latest precious metal spot prices for: gold, silver, platinum, and palladium. Prices can be displayed for troy ounces, or grams; and in the currencies GBP (£), USD ($), or EUR (€).

Shell 66.87% Roff 33.13%
unix linux cli shell curl jq sed trading gold silver

sp's Introduction

sp

Fetch the latest spot prices for precious metals, from the command line.

Description

sp fetches the latest precious metal spot prices by way of an undocumented API provided by a popular retail website. The API only updates every 2 minutes, so when using sp to automate requests, it is inadvisable to request any faster than this limit. Unfortunately, the details preceding means that sp is inherently unstable, and liable to break at any moment in time. Use caution as appropriate.

sp consists of a single POSIX compliant shell script, and is written in a portable manner - save for the small list of dependencies:

Despite the size of the project, and its narrow purpose, sp comes with a comprehensive man page, as all good tools should.

Purpose

To provide a way of fetching precious metal spot prices from the command line, so the data may be stored/used for further processing.

Example Output

The output of sp is purposefully designed to be as easy as possible to pipe to other unix tools - i.e., awk, jq, cut, etc. - and tries to follow the Unix Philosophy.

Without any arguments, sp should output something similar to:

01/06/17 18:58 gold 983.04 gbp toz
01/06/17 18:58 silver 13.388 gbp toz
01/06/17 18:58 platinum 723.29 gbp toz
01/06/17 18:58 palladium 641.45 gbp toz

To Do

  • Store ajax token to file for saving bandwidth when making repeat requests.

Copyright

sp is released into the public domain.

sp's People

Contributors

cyberdelica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cavemanguy

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.