Git Product home page Git Product logo

swgoh's People

Contributors

pikax avatar

Stargazers

 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

swgoh's Issues

panelMenus nodeValue = null

Getting error:

TypeError: Cannot read property 'nodeValue' of null
  at .../node_modules/swgoh/dist/index.cjs.js:330:91

Command to replicate this error:

const username = "ledia";
swgoh.profile(username).then(function (p) {
  console.log(p);
})

imageSrc is undefined

I'm receiving an error:

TypeError: Cannot read property 'slice' of undefined
    at Node.<anonymous> (.../node_modules/swgoh/dist/index.js:287:37)

The line causing the error is:

imageSrc: i$.attr("src").slice(2),

Ships stars

When the ship has 7 stars is parsed as 0*:
{ "code": "slave-i", "description": "Slave I", "imageSrc": "//swgoh.gg/static/img/assets/tex.charui_slave1.png", "star": 0, "level": 85, "crew": [ { "code": "boba-fett", "description": "Boba Fett", "imageSrc": "swgoh.gg/static/img/assets/tex.charui_bobafett.png", "star": 7, "level": 85 } ], "galacticPower": 36946, "maxGalacticPower": 49949 },

add guild information

Hello,

First of all, thanks a lot for the awesome work you did with this package ! :D
I believe it could be very usefull to have at least guild PG coming back from swgoh.guild method.

What do you think ?

Have a great day,

Adrien

swgoh.profile should return also the profile's character name

Please enhance the profile API to parse out the profile's character name and return it

username: name,

It is currently populating username with the swgoh.gg user name which is in the top panel. firefox reports the css selector and xpath currently being used to populate the username as follows:
h5.panel-title:nth-child(2) > a:nth-child(1)
/html/body/div[3]/div[2]/div[1]/div[1]/div[2]/h5/a

The character name for the profile can be found in the second panel which has identical markup. firefox reports the css selector and xpath for this character name as follows:
h5.panel-title:nth-child(1) > a:nth-child(1)
/html/body/div[3]/div[2]/div[1]/div[4]/div/div/h5/a

Possible CORS problem?

Using your starter code and my SWGOH credentials, I was unable to get my info from swgoh.gg. It seems like a CORS issue when trying to get "https://swgoh.gg/u//":

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Am I missing something completely or is there an issue with the swgoh.profile(username) function call somewhere?

Thanks!

Static resource links are not working

So far I've been using your lbirary by setting the img src attributes to the link that is provided for the toons. For example: https://swgoh.gg/static/img/assets/tex.charui_wampa.png
This link works in the browser but it doesn't work in the application.
I get the following error:
swgoh - issue
Is there a workaround for this issue? Or alternatively could you pack the static resources (images) to the library so we can reference them locally?

Thanks! And keep up the good work!

Best Regards,
Robert

Mods Lookup Failing

When entering a username for a mod, I am getting the following error:

Uncaught Promise Error:  TypeError: Cannot read property 'startsWith' of undefined
    at Swgoh.<anonymous> (/Users/richiegirardin/GitHub/mouse-bot/node_modules/swgoh/dist/index.js:419:34)
    at step (/Users/richiegirardin/GitHub/mouse-bot/node_modules/swgoh/dist/index.js:74:23)
    at Object.next (/Users/richiegirardin/GitHub/mouse-bot/node_modules/swgoh/dist/index.js:55:53)
    at fulfilled (/Users/richiegirardin/GitHub/mouse-bot/node_modules/swgoh/dist/index.js:45:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

It used to work before, but does not now.

Possible IP ban when collecting player's mod

I've created function to save player's mod into a file:

const swgoh = require("swgoh").swgoh;
const fs = require("fs");
const users = ["xvadrom"];
const saveToFile = name =>
{
    swgoh.mods(name).then(info =>
   {
   fs.writeFile(`./MODS/${name}.json`, JSON.stringify(info)),
                 function(err) {
      if (err) throw err;
  };
  });
};
users.map(user => saveToFile(user));

I've done it for all members in my guild. But after 3-4 member, another created files are incomplete or empty.
I've noticed that if i change my IP i can download 3-4 more player mods profiles and it starts blocking again.
8e7d0df794f2c5c411b4320a833055ff
above u can see that some created files are <200KB or even 1KB (empty) and all of them should be 200KB+

Profile Data undefined

For users that don't have ally codes on swgoh.gg, the joined field is being bumped up to allyCode.
screen shot 2017-09-13 at 5 31 08 pm

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.