GithubHelp home page GithubHelp logo

Comments (6)

Ericzion1999 avatar Ericzion1999 commented on September 3, 2024 2

Nintendo has announced new animal crossing amiibo cards
series 5 is coming😅

from amiibo_network.

EdwynZN avatar EdwynZN commented on September 3, 2024

Hi, I understand that problem and has been asked many times to sort by AC number card, but I'm using Amiibo API to fetch the latest data and there is no numbers assigned for each card so I have no proper way to order them unless some one write down all of the numbers by hand (I can see there is a number at the side of the ammibo card image, but still)

from amiibo_network.

Ericzion1999 avatar Ericzion1999 commented on September 3, 2024

I can you send Later the Name and the number

from amiibo_network.

Ericzion1999 avatar Ericzion1999 commented on September 3, 2024

https://drive.google.com/folderview?id=1b4pTnrQ_cA0_hy2qElP-WsqJmhbuJiEN

All names With Numbers

from amiibo_network.

EdwynZN avatar EdwynZN commented on September 3, 2024

Thank you for the information, I will look at it after some other updates I am working

from amiibo_network.

cesardka avatar cesardka commented on September 3, 2024

Hi, @EdwynZN! I am far from being a Flutter specialist (in fact, I never used this language before) but I decided to try things out and forked the repo to create a PR to start to implement this feature #29

It's 3:24AM, but I wrote a basic script to scrape https://animal-crossing.com/amiibo/collections/series-1-4-amiibo-cards/# and get the proper card numbers for each series instead of picking them manually:

const { writeFile } = require("fs");

const amiiboDatabase = require("./amiibos.json");
const amiiboCardsNumbered = require("./amiibosCardsNumbered.json"); // an auxiliary JSON file I created to list the card number and the card name for each series to append to the entries in amiibos.json

let amiibosWithNumbers = amiiboDatabase.amiibo;
let total = 0;

for (series in amiiboCardsNumbered) {
  for (amiibo of amiiboCardsNumbered[series]) {
    const indexAmiiboToBeReplaced = amiibosWithNumbers.findIndex(
      (a) => a.amiiboSeries === series && a.name === amiibo.name
    );

    if (indexAmiiboToBeReplaced >= 0) {
      total++;
      const amiiboWithCardNumber = {
        ...amiibosWithNumbers[indexAmiiboToBeReplaced],
        collectionNumber: amiibo.collectionNumber,
      };
      amiibosWithNumbers.splice(
        indexAmiiboToBeReplaced,
        1,
        amiiboWithCardNumber
      );
    }
  }
}

const newAmiiboDatabase = {
  ...amiiboDatabase,
  amiibo: amiibosWithNumbers,
};

writeFile(
  "./amiibos.json",
  JSON.stringify(newAmiiboDatabase, null, 2),
  (error) => {
    if (error) {
      console.error("[Error]", error);
      return;
    }
    console.log("[Success!!]", total, "cards updated!");
  }
);

Once I got (most) of that handled, all I need now is to learn Flutter (lol) and figure out what needs to be done in order to have the OrderBy considering this property.

Is there any guideline that I should follow?

from amiibo_network.

Related Issues (20)

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.