Coder Social home page Coder Social logo

nexuist / coinmarketcapapi Goto Github PK

View Code? Open in Web Editor NEW
54.0 54.0 24.0 7.95 MB

JSON API for coinmarketcap.com written in node and hosted on OpenShift.

Home Page: https://coinmarketcap-nexuist.rhcloud.com

JavaScript 31.07% HTML 24.76% Shell 44.18%

coinmarketcapapi's People

Contributors

altsheets avatar dakk avatar nexuist avatar renaatvives 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  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coinmarketcapapi's Issues

fresh install

/root/coinapi/lib/CoinFactory.js:25
"symbol": tds.eq(4).text().match(/\s([a-z]|[0-9])+\s/i)[0].trim().toLowerCase(),
^

TypeError: Cannot read property '0' of null
at CoinFactory.produce (/root/coinapi/lib/CoinFactory.js:25:62)
at Object. (/root/coinapi/lib/CoinCrawler.js:30:33)
at initialize.exports.each (/root/coinapi/node_modules/cheerio/lib/api/traversing.js:294:24)
at Request._callback (/root/coinapi/lib/CoinCrawler.js:29:14)
at Request.self.callback (/root/coinapi/node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/root/coinapi/node_modules/request/request.js:1171:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)

All currencies instead of top 100

Thanks for your work, first :-)
I'd like to use your piece of code on my VPS, but I'm not a coder, so I need a more detailed README or a INSTALL file, please !
The aim would be to be able to have all cryptocurrencies prices, not just the top 100... Would you please add this option, or create an INSTALL file ;-) ?

Paycoin API

Paycoin's price in the API is no longer updating with CoinMarketCap's price

Empty values returned

Hi guys - are you aware that this has stopped returning currency values?

http://coinmarketcap-nexuist.rhcloud.com/api/all :

{
"Bitcoin": {
"symbol": "btc",
"position": "1",
"market_cap": {
"usd": "4324763530.88",
"eur": "NaN",
"cny": "NaN",
"cad": "NaN",
"rub": "NaN",
"btc": "13352775.0"
},
"price": {
"usd": "323.885",
"eur": "NaN",
"cny": "NaN",
"cad": "NaN",
"rub": "NaN",
"btc": "1.0"
},
"supply": "13352775",
"volume": {
"usd": "101686000",
"eur": "NaN",
"cny": "NaN",
"cad": "NaN",
"rub": "NaN",
"btc": "312041.0"
},
"change": "4.21",
"timestamp": 1412595618.315
},

No Access-Control-Allow-Origin header

I'm developing a personal project that uses your API. It worked fine when I was using Safari to develop it, but when I tried to test in Chrome or any other browser, I got this error: "No 'Access-Control-Allow-Origin' header is present on the requested resource." I've done a bit of research into this, and most things I've found say that you have to change settings in the API server to enable CORS, but I obviously don't really have access to the server for this API. I could be using it wrong, but here is what I am doing in my code. Any advice?

$.ajax({
    type: 'GET',
    url: "http://coinmarketcap-nexuist.rhcloud.com/api/all",
    processData: true,
    data: {},
    dataType: "json",
    success: function (data) {
        processData(data);
    }
});

function processData(data){
     console.log(data);
     var btcvalg = data.btc.price.usd;
}

CoinFactory.js:25:64 - TypeError: Cannot read property '0' of null

any idea where this might be coming from?

0|main     | Wed Oct 18 2017 01:06:45 GMT+0000 (UTC): Server started.
0|main     | TypeError: Cannot read property '0' of null
0|main     |     at CoinFactory.produce (/root/CoinMarketCapAPI/lib/CoinFactory.js:25:64)
0|main     |     at Object.<anonymous> (/root/CoinMarketCapAPI/lib/CoinCrawler.js:30:33)
0|main     |     at initialize.exports.each (/root/CoinMarketCapAPI/node_modules/cheerio/lib/api/traversing.js:294:24)
0|main     |     at Request._callback (/root/CoinMarketCapAPI/lib/CoinCrawler.js:29:14)
0|main     |     at Request.self.callback (/root/CoinMarketCapAPI/node_modules/request/request.js:188:22)
0|main     |     at emitTwo (events.js:106:13)
0|main     |     at Request.emit (events.js:191:7)
0|main     |     at Request.<anonymous> (/root/CoinMarketCapAPI/node_modules/request/request.js:1171:10)
0|main     |     at emitOne (events.js:96:13)
0|main     |     at Request.emit (events.js:188:7)
PM2        | App [main] with id [0] and pid [3189], exited with code [1] via signal [SIGINT]
PM2        | Starting execution sequence in -fork mode- for app name:main id:0
PM2        | App name:main id:0 online
q0|main     | Wed Oct 18 2017 01:06:46 GMT+0000 (UTC): Server started.
0|main     | TypeError: Cannot read property '0' of null
0|main     |     at CoinFactory.produce (/root/CoinMarketCapAPI/lib/CoinFactory.js:25:64)
0|main     |     at Object.<anonymous> (/root/CoinMarketCapAPI/lib/CoinCrawler.js:30:33)
0|main     |     at initialize.exports.each (/root/CoinMarketCapAPI/node_modules/cheerio/lib/api/traversing.js:294:24)
0|main     |     at Request._callback (/root/CoinMarketCapAPI/lib/CoinCrawler.js:29:14)
0|main     |     at Request.self.callback (/root/CoinMarketCapAPI/node_modules/request/request.js:188:22)
0|main     |     at emitTwo (events.js:106:13)
0|main     |     at Request.emit (events.js:191:7)
0|main     |     at Request.<anonymous> (/root/CoinMarketCapAPI/node_modules/request/request.js:1171:10)
0|main     |     at emitOne (events.js:96:13)
0|main     |     at Request.emit (events.js:188:7)
PM2        | App [main] with id [0] and pid [3215], exited with code [1] via signal [SIGINT]
PM2        | Starting execution sequence in -fork mode- for app name:main id:0
PM2        | App name:main id:0 online
0|main     | Wed Oct 18 2017 01:06:47 GMT+0000 (UTC): Server started.

Not updating

This is exactly what I was looking for but it's not updating correctly (rates never change).

Full name is being truncated

Thanks to @XBTE on Twitter for pointing this out.

For coins like "MasterCoin (Omni)" the API is returning "MasterCoin (...". This is due to the fact that this is what the text on coinmarketcap.com says. The relevant HTML is below:

     <td class="no-wrap currency-name">
                    <img src="/static/img/coins/16x16/mastercoin.png" class="currency-logo" alt="Mastercoin (Omni)">
                    <a href="/currencies/mastercoin/">Mastercoin (..*</a>
                </td>

Thankfully, this appears to be an easy fix. Instead of extracting the name from the anchor tag we can just get the alt text from the img tag. I'll try to get this done soon.

OpenShift v2 End of Life'd

Hello everyone,

On September 30, 2017, OpenShift shut down their V2 online cloud hosting platform. This is what CoinMarketCapAPI was running on. If you try to access it now, you will get an HTTP 503 error. OpenShift is offering a new version of their platform but that will require some migration on my part to get the existing codebase to be compatible with it.

I am opening this issue to allow anyone who is interested to voice their opinion on the future of this project and provide any feedback they may have for me. If enough people want it, I will take the necessary steps to get this working on OpenShift again, or migrate to another platform like DigitalOcean.

Thank you all for your support,
Andi

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.