These are chat archives for arenanet/api-cdi

27th
Apr 2017
windwarrior
@windwarrior
Apr 27 2017 00:00
Today a computer told me
That i could not live where i was living
And blatandly called my adres a lie
("your adress is invalid", no its not I really live there)
Eearslya Sleiarion
@Eearslya
Apr 27 2017 01:25
to be fair, addresses are one of the worst things to deal with programmatically
right next to timezones
Michael Dougall
@madou
Apr 27 2017 01:36
@lye hey! whats the chances of opting into side stepping the rate limiting?
it's taking the armory 16 hours and growing to fetch data now :grimacing:
Archomeda
@Archomeda
Apr 27 2017 01:50
TIL it's called yoda
and TIL it actually matters in c++
Eearslya Sleiarion
@Eearslya
Apr 27 2017 02:01
Yeah, NULL == x won't trigger any custom == operators on x
Archomeda
@Archomeda
Apr 27 2017 02:02
i suppose it works the same in c# too
Eearslya Sleiarion
@Eearslya
Apr 27 2017 02:02
I think
Archomeda
@Archomeda
Apr 27 2017 02:02
since in c# you can overload operators too
Pat Cavit
@tivac
Apr 27 2017 05:24
writing bad conditionals because someone might've overloaded a comparison operator to do something stupid
the C++ story
windwarrior
@windwarrior
Apr 27 2017 09:44
to be fair, addresses are one of the worst things to deal with programmatically
but saying that I cant live where I live is also the worst way to recover from an error in your code :P
@madou sure, but what are you doing that requires more than 16*60*600=576000 requests?
Ah you're pulling character data as well, rip.
PM me your IP address(es) on gitter (or email lawton@arena.net) and I'll put 'em in
windwarrior
@windwarrior
Apr 27 2017 17:47
per API key/coupled user limits were infeasable right
they're not totally infeasible, but it requires some work
the rate limiting component we use for everything only keys off IP address
windwarrior
@windwarrior
Apr 27 2017 17:50
it would maybe fix this issue of bigger backend systems doing too many calls
thats all I wanted to say ^^
you're not wrong
I'll probably have to implement it at some point
windwarrior
@windwarrior
Apr 27 2017 17:52
yeah other APIs do it similarly. But yeah, not too much priority
Eearslya Sleiarion
@Eearslya
Apr 27 2017 19:21
darthmaim
@darthmaim
Apr 27 2017 19:21
wow those updates
Eearslya Sleiarion
@Eearslya
Apr 27 2017 19:23
Blueprints, blueprint books and deconstruction planners can be destroyed by clicking the trash can icon in their GUIs. Clearing a blueprint is still possible via the Shift+Right Click shortcut.
thank god
windwarrior
@windwarrior
Apr 27 2017 19:26
their development speed is insane
Eearslya Sleiarion
@Eearslya
Apr 27 2017 19:34
I honestly wonder how they can still support the development team they have, financially
Are game sales still that high?
windwarrior
@windwarrior
Apr 27 2017 19:42
I dont know
windwarrior
@windwarrior
Apr 27 2017 20:42
apparantly about 0.8M registered copies on steam
times 20 dollars each sale
thats 16M (minus the cut valve takes)
Eearslya Sleiarion
@Eearslya
Apr 27 2017 20:44
Hmm, I guess they can pretty reasonably coast by with $60-70k salaries for quite a while like that.
windwarrior
@windwarrior
Apr 27 2017 20:45
well I dont know what software dev wages are there
but yeah they are pretty good for a while
Archomeda
@Archomeda
Apr 27 2017 20:57
that doesn't even take into account the website sales
windwarrior
@windwarrior
Apr 27 2017 20:58
well I dont have any clue how long you can uphold a business of 15 people + a location + all other expenses for 20M dollar
my instinct says: "Quite a while"
Michael Dougall
@madou
Apr 27 2017 21:05
@lye ah I have a new IP every time I deploy, rip :P
windwarrior
@windwarrior
Apr 27 2017 21:06
0.0.0.0/0
ez
@madou if you're using EC2, you can get a static IP and assign it to the new instance as part of the deploy process
Michael Dougall
@madou
Apr 27 2017 21:50
Hmm I'll have a look into it. Reserved ips cost a little extra right
tho i want to offload the fetch to lambda, which would kill static ips again. but maybe i could just take slices of users and pass it to multiple lambdas instead. ill have a play.
Darrian
@rikkuness
Apr 27 2017 22:00
hey @lye , did you add the PR for guild based k/d? I couldn't find it when I had a scan earlier
crap I didn't
I haven't even written the frontend for it
I'm finishing up the bits for /v2/vendors
I'll do the guild KDR stuff next
Darrian
@rikkuness
Apr 27 2017 22:00
ay no worries :) just thought I'd drop it in here in case I missed something in the chat
Sunao
@SiteSunaorii_twitter
Apr 27 2017 22:36
Hi- I am a relatively new developer who just started working with APIs, and for a personal project, I wanted to make something working with GW2's API, but I'm having trouble with an approach to gathering all the data from the API. Given that the /items API returns an array of ID numbers, how do you get the data of each item without making a GET request for each item?
Darrian
@rikkuness
Apr 27 2017 22:37
you can make bulk requests, personally I use @queicherius ' library off of GitHub because he's a legit dude and javascript is win
that has a bulk method on it and also caching ability :)
Sunao
@SiteSunaorii_twitter
Apr 27 2017 22:39
not working with Node unfortunately for this one (though I'd like to eventually!), but bulk requests? Thanks I'll look into it!
Darrian
@rikkuness
Apr 27 2017 22:41
yeah yeah you pass an ID list, but there's a limit so generally you get the list of all ID's, chunk it up into the max amoutn and then make multiple GET's
Sunao
@SiteSunaorii_twitter
Apr 27 2017 22:41
What is that limit generally?
Darrian
@rikkuness
Apr 27 2017 22:42
I can't remember off hand, I think it was maybe like ~200
it's 200
Darrian
@rikkuness
Apr 27 2017 22:43
yeah yeah 200
@SiteSunaorii_twitter The easiest approach, IMO, is to paginate through them via /v2/items?page_size=200&page=0; the total number of pages is returned in the X-Page-Total response header
Darrian
@rikkuness
Apr 27 2017 22:44
I couldn't actually see it in the Wiki so I referred to @queicherius again ;) https://github.com/queicherius/gw2api-client/blob/master/src/endpoint.js#L20
Sunao
@SiteSunaorii_twitter
Apr 27 2017 22:47
Thanks! I'll give that a shot
Since I've never worked with large amounts of data with an API before, I'm wondering what would be better practice? Given data like commerce/tradingpost data is dynamic, would it better to cache or use a database and update the database every X amount of minutes?
Darrian
@rikkuness
Apr 27 2017 22:53
cache and only pull as needed, the API is now rate limited and good practice you want to make as few calls as possible
the problem with duplicating and storing in your own database with any data is that it's never the "true" source of information
for something like a website showing data from the GW2 API, it's often better to have the client side do the requests, that way your server is running minimal bandwidth load and the rate limiting should never be an issue, unless you're doing something crazy
you often don't really need to pull every single market listing
@SiteSunaorii_twitter The responses' Expires/Cache-Control headers contain the cache expiry times on the API's side, so the resource can be expected to stay the same for that duration.
For /v2/commerce/listings, if it's too much data to ingest, you can truncate the listings using the poorly-documented ?top parameter, e.g. https://api.guildwars2.com/v2/commerce/listings?page=0&top=3
Eearslya Sleiarion
@Eearslya
Apr 27 2017 23:03
@queicherius I knew it was going downhill when I saw the pi
Darrian
@rikkuness
Apr 27 2017 23:05
woah Pi's are cool in the right place ;D haha I have a DNS caching server and I control my telescope with one
but legit that "secure" server is hilarious