Coder Social home page Coder Social logo

leaguejs's People

Contributors

claudiowilson avatar cliffordduke avatar colorfulstan avatar darkintaqt avatar eldorandev avatar ericengineered avatar ferderber avatar frosthaven avatar gitter-badger avatar jhgaylor avatar johnz133 avatar kubuxu avatar passion4code avatar patrickshuff avatar quenting3 avatar snyk-bot avatar souler avatar ssesfahani avatar tplaindoux avatar tzwel avatar un0btanium 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  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

leaguejs's Issues

CORS isssue

Hi there,

Is there any solution or an example on how to bypass CORS issues with this package?

I'm developing a personal site where I would like to display riot stats within a page. I'm using NextJS for the frontend and Strapi for the backend.

Add Tag support to StaticData / DataDragon methods

For most StaticData pseudo "Endpoints" the whole Datadragon file is returned.

This might include a lot of unneeded data and has to be filtered out by the consumer of this library.

Restoring the StaticData Endpoint behaviour, to respect the tags option (and dataById where needed) would be great.

Fix Readme

  • ThirdpartyCode Endpoint missing in /endpoints
  • require for lib got refactored unintended

LeagueJS and Crodova?

Hello, I am using Cordova and after looking for two days and before asking in some Cordova forum I wanted to know if it´s possible to use LeagueJS in this kind of technology. I installed it (so it is in node_modules) but I can´t find the module in the JS using require() (cordova.require() in my case).

Thank you.

Deprecation of LeagueEndpoint.gettingLeagueBySummonerId

https://discussion.developer.riotgames.com/articles/3677/the-deprecation-of-the-league-v3getallleaguesforsu.html

  • add Deprecation warning and note
  • add new getLeagueById implementation
  • update docs regarding new leagueId property
  • propably add leagueIds to GameConstants

Endpoint will be removed on January 10th

Since the breaking change is not imposed by the library and since the endpoint will stop working within the old versions anyways, versioning will propably stay on 1.x

Work out StaticData / DDragon caching

For now, DataDragon files are stored on the filesystem without expiration (since they don't change).

In-memory caching is used for

  • versions array
  • languages array
  • realms file (array and specific realm files)
    with a 4h cache.

I assume for the use cases this library is used for this should be fast enough, I might tinker with it at some point, but for now this is good enough for me.

Suggestions / Pull requests always welcome of course.

Match-V5 support

Match-V4 support is being deprecated on September 13, 2021.

Match-V5 is now available for production keys.

For this library to stay relevant it will need Match-V5 support.

Deprecation of the lol-static-data-v3 API

https://discussion.developer.riotgames.com/articles/5719/removal-of-the-lol-static-data-v3-api.html

August 27th Static Data endpoints will be removed.

I'm in the process of adding DataDragon support, but not sure if I will get to rewire all the methods in time.

Simply delivering the DataDragon files through the endpoint methods would be a good first step to prevent a breaking change, but adding the options back in might be a pain, and possibly not worth the effort.

Open for discussion and contribution, will update here when the DataDragon integration is live.

Second call to league.Match.gettingById invisbly fails

I'm writing a basic tool to grab a list of matches from the past 24 hours and just console.log them right now. I'm successfully getting the matchlist with the encrypted summoner ID. Then, I'm getting the detailed data by getting with the matchID. I'm trying to do this for the entire matchlist but it only works for the first one in the matchlist. Running through a debugger, it appears that the code just mysteriously (and without an error) crashes at MatchEndpoint.js:48.

I'm sure that getting a summoner's list of matches and the details about them is a fairly solved challenge so I'm guessing this issue doesn't actually require a fix. That said, it seems like something wonky is going on with my use of your library - not my use of Promises and async/await more broadly.

My project is will be open so I have the luxury of sharing my code with you:

const league = new (require('leaguejs'))(process.env.LEAGUE_KEY);
const { season, queue } = require('./constants');

exports.getSummonerDataSince = async beginTime => {
  const matchList = (await league.Match.gettingListByAccount(
    process.env.LEAGUE_ACCOUNT_ID,
    process.env.LEAGUE_API_PLATFORM_ID,
    { beginTime },
  )).matches;

  const data = [];

  for (let match of matchList) data.push(await getGameData(match.gameId));

  return data;
};

const getGameData = async matchId => {
  console.log('start fetch');
  const fullData = await league.Match.gettingById(matchId);
  console.log('data fetched');
  return {
    season: season(fullData.seasonId),
    queue: queue(fullData.queueId),
    duration: fullData.gameDuration,
  };
};

// this code only printed out "start fetch", "data fetched", "start fetch"

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.