Giter Site home page Giter Site logo

cryptocompareapi's Introduction

Hello ๐Ÿ‘‹

I'm Josh, I like working on different projects!


For fun I made chess using React/Remix that runs in my profile.

Repo: https://github.com/Josh-McFarlin/remix-chess

You are the white piece. Click a piece to select it and it will turn blue. The green squares show where you can move.

A B C D E F G H
8 A8 B8 C8 D8 E8 F8 G8 H8
7 A7 B7 C7 D7 E7 F7 G7 H7
6 A6 B6 C6 D6 E6 F6 G6 H6
5 A5 B5 C5 D5 E5 F5 G5 H5
4 A4 B4 C4 D4 E4 F4 G4 H4
3 A3 B3 C3 D3 E3 F3 G3 H3
2 A2 B2 C2 D2 E2 F2 G2 H2
1 A1 B1 C1 D1 E1 F1 G1 H1

Game Stats


๐Ÿ“– Learn More About Me:


๐Ÿ“ซ How to reach me:

Connect on LinkedIn

Contact Form

cryptocompareapi's People

Contributors

josh-mcfarlin avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

cryptocompareapi's Issues

Exception OutOfCallsException raised after multiple call of Historic.getPriceAtTime method

I'm trying to get price of Ether in USD from a CSV file. In each row, I have a timestamp and other informations. The file contains less than 27k rows.

I want to get the price of the Ether for each row from the timestamp. I used the method :

Historic.getPriceAtTime(Integer.valueOf(TimestampFromCsvFile), "ETH", "USD")

This method works fine but after a number of rows treated I get the following exception :

me.joshmcfarlin.CryptoCompareAPI.Utils.OutOfCallsException: No more HISTO calls are left, please try later.

Can someone explain me ? Thanks in advance.

Issue importing project from maven

Hi,

I wanted to use your wrapper in my project but it is not on maven repository anymore.

me.joshmcfarlin
CryptoCompareAPI
1.0-SNAPSHOT

"Missing artifact"

Is your readme not up to date?

Tyvm

a few extensions

Hi Josh

This project is useful, many thanks. I've had to hack a few extensions in to get it to do what I need though. Rather than a PR I'll just leave them here for you to do with as you wish as they need to be applied to all methods and better integrated.

  1. Add some more fields
    `
    public static History getHourFullargs(String fromSym, String toSym, int limit, String exchange, int aggregate, Integer toTs)
    throws IOException, OutOfCallsException {
    String formattedUrl = String.format("https://min-api.cryptocompare.com/data/histohour?fsym=%s&tsym=%s&limit=%d&e=%s&aggregate=%d",
    fromSym.toUpperCase(), toSym.toUpperCase(), limit, exchange, aggregate);

     if (toTs != null) {
     	formattedUrl = String.format("%s&toTs=%d", formattedUrl, toTs);
     }
     
     System.out.println(formattedUrl);
     
     Reader r = Connection.getJSON(new URL(formattedUrl), CallTypes.HISTO);
     return new Gson().fromJson(r, History.class);
    

    }
    `

  2. Wrap for limits > 2000:
    `
    private static List getHourHistory(CurrencyPair pair, int hours) throws IOException, OutOfCallsException {
    int samples = hours;
    List listData = new LinkedList<>();
    Integer timeFrom = null;
    Set listTimes = new HashSet<>(hours);

     boolean done = false;
     
     while (!done) {
     	// only returns ~2000 at a time
     	Historic.History history = Historic.getHourFullargs(pair.base.toString(), pair.counter.toString(), samples, "Cryptopia", 1, timeFrom);
    

// System.out.println(history.timeFrom + ", " + history.data.size());

		timeFrom = history.timeFrom - 1 ;	// start time of samples
		samples -= history.data.size();

// listData.addAll(history.data);

		for (Data data : history.data) {
			if (listTimes.contains(data.time)) {
				System.out.println("Duplicate timestamp: " + data.time + ", record ignored.");
			} else {
				listTimes.add(data.time);
				listData.add(data);
			}
		}
		
		if ((samples <= 0)
			||(history.timeFrom <= 0)
			||(history.data.size() <= 0)
			){
			done = true;
		}
	}

// System.out.println(listData.size());
return listData;
}
`

  1. Useful for debugging:
    @Override public String toString() { return "Data [time=" + time + " (" +Instant.ofEpochSecond(time) + ")" + ", open=" + open + ", high=" + high + ", low=" + low + ", close=" + close + ", volumeFrom=" + volumeFrom + ", volumeTo=" + volumeTo + "]"; }

Issue importing project

Hi Josh,

I've used the maven dependency you've provided in your readme and I'm having issues importing it.
image

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.