Giter Club home page Giter Club logo

albion-api's Introduction

Matt Smith - ๐Ÿ‘‹

Hi, I'm Matt โ€” a senior software engineer at Riot Games, working on a wide variety of commerce products.

โšก Recent Activity

  1. ๐Ÿ—ฃ Commented on #68 in Karl-HeinzSchneider/WoW-DragonflightUI
  2. โ—๏ธ Opened issue #68 in Karl-HeinzSchneider/WoW-DragonflightUI
  3. ๐Ÿ’ช Opened PR #32 in psykzz/psybot
  4. ๐Ÿ—ฃ Commented on #4 in psykzz/albion-api
  5. โŒ Closed PR #4 in psykzz/albion-api

๐Ÿ“ซ How to reach me

Pretty much anything @psykzz.

Notable mentions / callouts

  • @neamar - A highly recommended individual, who I've worked with in the past.

visitors

albion-api's People

Contributors

psykzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

albion-api's Issues

Cannot seem to parse the output

Every time I try to get something back using nodejs I keep getting the following:
sytnax error 1 unexpected token < in json at position 0

I've tried installing packages for parsing HTML, but I cannot seem to get anything to work.

Could you tell me the proper way to log the information I am getting back to the console?

Thanks!

Edit:
I am able to get a return if I alter this code as follows:

function baseRequest(uri, cb) {
  request(`${BASE_URL}${uri}`, function (error, response, body) {
    debug(`Url: ${BASE_URL}${uri} statusCode: ${response && response.statusCode}`);
    //cb(error, JSON.parse(body));
    cb(error, body);
  });
}

Then if I do a getPlayerInfo("characterName", console.log) it'll output the entire HTML response to the console.

(using characterName as an example here, I tried it with my own character name)

Edit:::

I figured out what I was doing wrong. I was trying to pass a character name string into getPlayerInfo, but it wanted the actual ID. I was able to get that back using search("playerName", console.log), and then use that id string in getPlayerInfo('playerIdFull', console.log) and it outputted the correct information.

The output below is caused by passing in the wrong information. If you don't give it valid criteria, then it passes back an HTML element.

Thanks!

Output is as follows:

$ node index.js

null '<html>\n<head>\n
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\n
<title>Error 404 Not Found</title>\n
</head>\n<body><h2>HTTP ERROR 404</h2>\n
<p>Problem accessing /api/gameinfo/players/characterName. Reason:\n
<pre>Not Found</pre></p>
<hr><i>
<small>Powered by Jetty://</small>
</i><hr/>\n\n</body>\n</html>\n'

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.