Giter Club home page Giter Club logo

dolar-blue's Introduction

dolar-blue

API to get the current dolar blue rate in Argentina, from various sources.

Synopsis

var dolarblue = require('dolar-blue');

dolarblue(function (err, data) {
    if (err) { console.log("Error: " + err);}

    console.log(data.date + ": el dolar blue esta a "  + data.rates.buy  + " - "  + data.rates.sell);
    console.log('\tsource: ' + data.source.name + ', last update: ' + data.rates.date);
    console.log("\tDebería comprar?");
});

API

dolarblue( callback(err, data) )

Query all supported sources and return results from the most recently updated source.

Example Response:

The following is an example of the JavaScript object returned by a successful result:

{ date: Fri Oct 24 2014 14:27:32 GMT-0700 (PDT),
  source: 
   { name: 'LaNacion',
     uri: 'http://contenidos.lanacion.com.ar/json/dolar' },
  data: 
   { Date: '2014-10-24T00:00:00-03:00',
     CasaCambioVentaValue: '8,49',
     BolsaCompraValue: '13,37',
     BolsaVentaValue: '13,37',
     InformalVentaValue: '14,7',
     CasaCambioCompraValue: '8,49',
     InformalCompraValue: '14,58' },
  rates: 
   { buy: 14.58,
     sell: 14.7,
     source: 'LaNacion',
     date: Thu Oct 23 2014 20:00:00 GMT-0700 (PDT) },
  LaNacion: 
   { Date: '2014-10-24T00:00:00-03:00',
     CasaCambioVentaValue: '8,49',
     BolsaCompraValue: '13,37',
     BolsaVentaValue: '13,37',
     InformalVentaValue: '14,7',
     CasaCambioCompraValue: '8,49',
     InformalCompraValue: '14,58' } }

Notes:

Date values are in ISO8601 format and are suitable for

var date = new Date(data.date);

Alternatively, you can explicitly specify a source to use (see list of sources below for acceptable values):

dolarblue({src:"LaNacion"}, callback);
dolarblue({src:"Bluelytics"}, callback);

Sources

TODO

Add support for additional data sources.

Licence

The MIT License (MIT)

Copyright (c) 2014 Matias Alejo Garcia.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

dolar-blue's People

Contributors

andrewfhart avatar gabegattis avatar gabrielbazan7 avatar matiu avatar sicarul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dolar-blue's Issues

Add Governmental Dolar

Hi @matiu, excelent work there!,

Do you have any plans of adding the "Official" dolar?.
Which are the license of this project?, also, can you add them?

I'd love to contribute here ;)

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.