Giter VIP home page Giter VIP logo

btc.el's Introduction

btc.el - Get BTC value inside Emacs.

You can use btc-mode minor mode to show BTC rate in the mode-line or use this library in elisp code to get rates for something else.

  • Get default rate (see Customization)
    (btc-get-rate)  ;; => 31015.6217
        
  • Get rate by code
    (btc-get-rate-by-code "usd")  ;; => 31015.6217
        

Installation

Via use-package

(use-package btc
  :ensure nil
  :quelpa
  (btc :repo "pkulev/btc.el"
       :fetcher github :upgrade t)
  ;; NOTE: Don't do this if you wan't just use the library
  ;;       Minor mode is for showing rate in the mode-line.
  :config
  (btc-mode))

Customization

You have several customize variable to play with. use-packages’s :custom section is good for setting theese bad boys:

(use-package btc
  ;; other things you already know
  :custom
  (btc-format-string "%0.3f" "I need more precise result!")
  (btc-update-interval 2 "Every 2 seconds please, I have lots of CPU"))
btc-url
url for data source

Actually not useful, because getting rate value is tightly coupled with default source, but who knows, maybe I’ll abstract this eventually.

btc-format-string
format string for rate value

This string will be passed to format function each time rate updates.

btc-currency-code
currency code to convert BTC to

Tightly connected to couindesk API and JSON data it returns.

btc-currency-sign
currency sign to show with rate

For now you can’t customize it’s place. Definitely need to refactor this code.

btc-update-interval
BTC rate update interval

It’s one minute by default. Set in seconds.

btc.el's People

Contributors

pkulev avatar

Stargazers

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