Pages: [1] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
Oublier Heliock
Syndicate of Ale
0
|
Posted - 2017.03.21 16:44:12 -
[1] - Quote
Gosh, for the life of me I can't find the end point in ESI https://esi.tech.ccp.is/latest/#/ where you get the ship_type_name from ship_type_id?
Looking at a killmail example:
"victim" => { "damage_taken" => 1556, "ship_type_id" => 603, "character_id" => 96003963, "corporation_id" => 98436366, ...}
Should be a Merlin. (603)
Thanks in advance for pointing me in the right direction. |
Slivo
Beehive Surveillance X877.
26
|
Posted - 2017.03.21 16:56:13 -
[2] - Quote
Try https://esi.tech.ccp.is/latest/#!/Universe/get_universe_types_type_id
EveHQ Development Team
Follow us on EveHQ.co | Twitter | Facebook
|
Oublier Heliock
Syndicate of Ale
0
|
Posted - 2017.03.21 17:02:16 -
[3] - Quote
Yup yup. Thanks a bunch!
|
Blacksmoke16
Resilience.
51
|
Posted - 2017.03.21 18:38:36 -
[4] - Quote
Easier way would be to just lookup the ship_type_id in the SDE vs doing a separate call to just get the name, assuming you have access to a database with the SDE. |
Oublier Heliock
Syndicate of Ale
0
|
Posted - 2017.03.21 20:42:42 -
[5] - Quote
Blacksmoke16 wrote:Easier way would be to just lookup the ship_type_id in the SDE vs doing a separate call to just get the name, assuming you have access to a database with the SDE.
Yes - thanks for that! I didn't realize that you can download the SDE and everything in it is in "yaml" format! I'll just use the needed yaml files for static lookups like this. This one specifically: fsd/typeIDs.yaml
I had created a universe class and a "get_type" method for this; and then plucked the name out of there. Which is like hammering a nail with and elephant tusk. Just to pull 15 killmails with readable data was taking near 10 seconds...
Also, I think I just wanted an excuse to create a "class Universe" in Ruby. :) I guess I can still use it to pull from the yaml file.
Thanks! |
Blacksmoke16
Resilience.
52
|
Posted - 2017.03.21 20:50:59 -
[6] - Quote
https://www.fuzzwork.co.uk/dump/
Steve provides the conversions if you want to use PostGres or MySQL etc
Also +1 for the Ruby ;) |
Oublier Heliock
Syndicate of Ale
0
|
Posted - 2017.03.21 21:56:53 -
[7] - Quote
NoSql, Mongoid instead of activeRecord. As you have surmised, I am using RoR with mongoDB. Also on Heroku. :)
I was thinking something like... (pseudo code)
class Universe require 'yaml' def getShipname(ship_type_id) object = YAML.load_file('fsd/typeIDs.yaml') ... return ship_name end end
then:
ship_name = Universe.getShipname('603')
maybe, this is no good...? I'll defiantly check out your suggestion though. I can still use activeRecord to talk SQL if I need to. |
Oublier Heliock
Syndicate of Ale
0
|
Posted - 2017.03.23 06:08:57 -
[8] - Quote
I ended up creating a Ship mongoid model with name and ID . So basically I still call ESI to get the ship name, but first I look at my Ship model and if it the id, name doesn't exist then add it. A sort of self building ship_id to ship_name lookup mongo collection with a RESTFUL interface to boot. So when I want to stop being lazy I can use the REST interface later to populate all ship id's and names; however if I'm lazy enough I'll eventually have them all anyway.
Ship.find_by(ship_type_id: ship_type_id).ship_type_name
|
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |