gclem / overwatch-js Goto Github PK
View Code? Open in Web Editor NEWOverwatch NodeJS API : Retrieve informations about heroes/players from Overwatch Official Website
License: MIT License
Overwatch NodeJS API : Retrieve informations about heroes/players from Overwatch Official Website
License: MIT License
I want to create a Discord bot that show you your overwatch profile.
I know everythings I need to know, exept HOW TO CATCH INFORMATION FROM THE CONSOLE (Like player level or rank)
How to do it ?
Thanks !!
Edorion
I'm using overwatch-js to check some users profile in batch, and recently all competitive and quickplay data is empty. Maybe some issue with playoverwatch.com parser ?
Quote from @Tresmos
Sometimes its "competitive.global.games_lost",
sometimes "competitive.global.{count,_plural,one{game}other{games}}_lost".
Is there any way to get the most played hero ?
Thanks
Hello, would it be possible an option to set the language from the Achievements name and description into any other of the available locales? Thanks in advance.
Hey!
I've been using your library for a while, but since the 29th of september its broken. It breaks on the getOverall()
method giving the following error:
Unhandled rejection TypeError: Cannot read property 'NaN' of undefined at parseProfile (/Users/daan/NodeJS/freewingiveawaybot/node_modules/overwatch-js/lib/overwatch.js:154:66) at Promise (/Users/daan/NodeJS/freewingiveawaybot/node_modules/overwatch-js/lib/overwatch.js:282:34) at new Promise (<anonymous>) at rp.then (/Users/daan/NodeJS/freewingiveawaybot/node_modules/overwatch-js/lib/overwatch.js:281:21) at tryCatcher (/Users/daan/NodeJS/freewingiveawaybot/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/Users/daan/NodeJS/freewingiveawaybot/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/Users/daan/NodeJS/freewingiveawaybot/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/Users/daan/NodeJS/freewingiveawaybot/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/Users/daan/NodeJS/freewingiveawaybot/node_modules/bluebird/js/release/promise.js:693:18) at Async._drainQueue (/Users/daan/NodeJS/freewingiveawaybot/node_modules/bluebird/js/release/async.js:133:16) at Async._drainQueues (/Users/daan/NodeJS/freewingiveawaybot/node_modules/bluebird/js/release/async.js:143:10) at Immediate.Async.drainQueues (/Users/daan/NodeJS/freewingiveawaybot/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:696:18) at tryOnImmediate (timers.js:667:5) at processImmediate (timers.js:649:5)
If you could take a look at it that would be great, otherwise let me know if I need to dig in to fix it!
I found the solution about my last problem, but now when I want the player rank (data.profile.rank
)
It return undefined.
But if I search for data.profile.level
or data.profile.avatar
It work...
HELP !!
The website has been changed a bit recently:
https://playoverwatch.com/en-us/search/account-by-name/<name>
as a JSON endpoint directlyMaybe there are some more changes, but this is all I know of.
profile.rank is returning NaN for any player, ranked or not in current season.
On last sunday, playoverwatch.com was returning error for any profile, and when it came back, this error showed. Maybe some issue in html parse ?
.getOverall's profile doesn't return tier.
Using
API.search("Mielophone-2188");
Returns the following
{
"careerLink": "/career/pc/eu/Mielophone-2188",
"platformDisplayName": "Mielophone#2188",
"level": 83,
"portrait": "https://blzgdapipro-a.akamaihd.net/game/unlocks/0x0250000000000BAF.png",
"platform": "career",
"region": "pc",
"tier": 14
}
As you can see the platform and region property values are not correct
overwatch.js
self.search = (username) => {
var options = {
uri: getSearchUrl(username),
json: true
};
return rp(options).then((datas) => {
_.each(datas, (player) => {
var i = player.careerLink.split('/');
player.platform = i[1];
player.region = i[2];
player.tier = (player.level - player.level % 100) / 100;
player.level = player.level % 100;
});
return datas;
})
.catch(handle);
}
should be
self.search = (username) => {
var options = {
uri: getSearchUrl(username),
json: true
};
return rp(options).then((datas) => {
_.each(datas, (player) => {
var i = player.careerLink.split('/');
player.platform = i[2];
player.region = i[3];
player.tier = (player.level - player.level % 100) / 100;
player.level = player.level % 100;
});
return datas;
})
.catch(handle);
}
owjs
.getAll('xbl', 'us', 'Golden Wolf833')
.then((data) => console.dir(data, {depth : 2, colors : true}) );
Returns the error "PROFILE_NOT_FOUND"
My bot I was working on a long time ago dont work anymore.
I tried to fix it, but (as you can see), the api is returning slightly less data than before :
{ profile:
{ nick: 'Speedy',
level: 31,
avatar:
'https://d15f34w2p8l1cc.cloudfront.net/overwatch/600a5cc024fa3daeca4eb397e5fcec66417a12ef47e2920dba1f835c25a7096c.png',
rank: NaN,
tier: '',
platform: '',
url: 'https://playoverwatch.com/en-us/career/pc/eu/Speedy-23165' },
competitive:
{ global: { masteringHeroe: undefined },
heroes: { competitive: {} } },
quickplay:
{ global: { masteringHeroe: undefined },
heroes: { quickplay: {} } },
achievements: [] }
Any idea ?
Maybe should I use another api (sadly, because this is the best one), or maybe an update is required...
Thanks
Hi,
I'll make some Overwatch API nodes available for public use, surely with quotas except for contributors.
If anyone has needs, let me know.
Example: https://playoverwatch.com/en-us/career/pc/eu/Salvage-11179
My average damage as Genji in QP is 6,362.44, however, returned for data.quickplay.heroes.genji.damage_done_average is 6.
This applies to both comp and QP.
Besides that small annoyance, I am really thankful for this awesome module!
The search function suddenly started returning an error when trying to use it. I narrowed it down to this part of the source code- overwatch.js:317. It is trying to split player.careerLink even though player.careerLink is undefined. player doesn't contain a careerLink object.
Hey there!
I noticed that I cannot use overwatch-js with any Node version above 6. I suppose it's compatible with higher versions, but I haven't fully tested it. Can you take a look at
"engines": {
"node": "6.0.0"
},
inside package.json and support higher versions?
names with weird characters don't work like SĔNPAI-1698 if you want to get the data you need todo S%C4%94NPAI-1698
There's a mismatch between the SR that the API calls and the "rank" that it lists (i.e. Silver, Diamond, Master...)
Examples I can call upon are as follows:
My Account reads 3040 SR but displays the rank as Master, when it should be Diamond.
A friend's account reads 2772 SR, ranks Diamond. Should be Platinum.
A friend's alt ranks 2588 SR, ranks Diamond. Should be Platinum.
A random account I scraped off of BattleNet had an SR of 734, and classed as Gold. THIS IS BRONZE.
Clearly there's some kind of issue with how the API interprets the ranking. It's probably a simple fix.
How do you search for a player with GetAll.
I'm trying to attach this to discord but I need it to search for the player while also getting all their stats.
I guess due to the switch to private profiles the data is empty again?
https://playoverwatch.com/en-us/news/patch-notes/pc#patch-47946
Good evening,
I was trying to use Overwatch.getAll('pc', 'eu', 'TheDarangel#2161')
when I faced this error:
TypeError: Cannot read property 'replace' of undefined
at parseProfile (C:\Users\TheDarangel\Desktop\nspire-ow-bot\node_modules\overwatch-js\lib\overwatch.js:148:65)
at Promise (C:\Users\TheDarangel\Desktop\nspire-ow-bot\node_modules\overwatch-js\lib\overwatch.js:262:34)
at new Promise (<anonymous>)
at rp.then (C:\Users\TheDarangel\Desktop\nspire-ow-bot\node_modules\overwatch-js\lib\overwatch.js:261:21)
at tryCatcher (C:\Users\TheDarangel\Desktop\nspire-ow-bot\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\TheDarangel\Desktop\nspire-ow-bot\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (C:\Users\TheDarangel\Desktop\nspire-ow-bot\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\Users\TheDarangel\Desktop\nspire-ow-bot\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Users\TheDarangel\Desktop\nspire-ow-bot\node_modules\bluebird\js\release\promise.js:693:18)
at Async._drainQueue (C:\Users\TheDarangel\Desktop\nspire-ow-bot\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (C:\Users\TheDarangel\Desktop\nspire-ow-bot\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues (C:\Users\TheDarangel\Desktop\nspire-ow-bot\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:773:18)
at tryOnImmediate (timers.js:734:5)
at processImmediate [as _immediateCallback] (timers.js:711:5)
Here is the career link: /career/pc/TheDarangel-2161
This may be related to the fact this career got two player-level
divs ?
When I try to get hero information, I get an empty object.
This is what I've attempted to do:
console.log(data.quickplay.heroes);
returns {}
Alternatively, when I do:
console.log(data.quickplay.heroes.roadhog);
returns undefined
Thanks for this module!
It would be awesome if we could get some info on the achievements for the player.
-SFD
I've been writing a module of my own similar to this one and I've noticed that the structure has changed in a few subtle ways. For example the old season 1 and 2 ranks are no longer in the page. 2) time played table field is now true time_played down to the second which is awesome.
However it's also been reporting strange numbers for damage_done fields for some players, some of the time. Right now for example, some players' heroes will display the same number for both hero_damage_done and hero_damage_done_most_in_game.
I suspect the overwatch web dev team are doing some work to move over to their new API that launched last week. If I'm right, these changes will likely continue for some time and we may even see the frontend completely rewritten.
Hopefully Blizzard decides to share their shiny new overwatch API with the public, and we don't need to resort to this awful scraping junk. :D
Thought you'd like to know ;)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.