GithubHelp home page GithubHelp logo

psychiccat / btc-priceimg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fordhurley/btc-priceimg

0.0 2.0 0.0 63 KB

Bitcoin Price Image Generator

Home Page: http://btc-priceimg.herokuapp.com

License: GNU General Public License v3.0

Makefile 1.07% Python 50.36% CSS 44.89% HTML 3.68%

btc-priceimg's Introduction

Bitcoin Price Image Generator

The bitcoin price image generator is a simple tool that creates a dynamic image of a price in BTC, based on a fixed USD price. The resulting image can be embedded in a forum post, for example, and it will always show an up-to-date BTC equivalent price. This is useful when you want to show a price for something in BTC, but you want the price to be pinned to a USD value (and not have to update your post every day as the BTC/USD exchange rate fluctuates). This tool relies on the global weighted average from BitcoinAverage.

Problems? Suggestions? Open an issue.

Source available on GitHub.

The advanced version of the tool allows for a choice of currency (BTC or LTC for now). Read about it below.

Usage

Simply build a URL of the form:

http://btc-priceimg.herokuapp.com/img/<price_in_usd>

Where <price_in_usd> is the price you want in USD.

You can also add an optional color argument to change the color of the text:

http://btc-priceimg.herokuapp.com/img/<price_in_usd>/<color>

The color code should be an html-like hex code (for white: ffffff or fff or simply f). See wikipedia for more info. The background of the image will be transparent.

Example

Say you want to sell an item for $10. You can generate an image using:

http://btc-priceimg.herokuapp.com/img/10.00

Which will yield the image:

If you want to change the color (to more closely match the text in your forum post, for example), use:

http://btc-priceimg.herokuapp.com/img/10.00/00f

Which yields:

You can then embed the image in your post using that URL. In BBCode, this would be:

[img]http://btc-priceimg.herokuapp.com/img/10.00[/img]

Advanced Version

The advanced version is available to allow changing the display currency, and allow for fancier options in the future. The URL format is of the form:

http://btc-priceimg.herokuapp.com/advimg?price=<price>&currency=<currency>&color=<color>

Arguments:

  • price: the desired price in USD, e.g. 10.0. Include a currency code to use something else as your reference, like 1.5EUR.
  • currency: should be BTC or LTC. Defaults to BTC.
  • color: same as in the basic version above.

Example:

http://btc-priceimg.herokuapp.com/advimg?price=10USD&currency=BTC&color=f00

Balance Checker

An additional tool allows you to check the balance of any bitcoin address using the API from blockchain.info. Simply build a URL of the form:

http://btc-priceimg.herokuapp.com/balance/<address>/<color>

As in the basic version above, the color argument is optional and accepts html-like hex codes.

Example:

http://btc-priceimg.herokuapp.com/balance/122LV3CNADj1yHU2tFPEhcCWR5QbfMzNcm

by Ford Hurley (122LV3CNADj1yHU2tFPEhcCWR5QbfMzNcm)

btc-priceimg's People

Contributors

bitdeli-chef avatar fizzisist avatar fordhurley avatar psychiccat avatar

Watchers

 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.