These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Every Officer Mod In Eve With typeID

Author
Bender Bending
Royal Amarr Institute
Amarr Empire
#1 - 2017-03-01 20:47:01 UTC
This took me over 24 hours to create, mainly because I'm still learning but also because I suck at scripting.
Anyway, I don't know who else will need this but a google search revealed the same question the forums a few times.

Plain text: http://pastebin.com/gRT9KbGB

JSON: http://pastebin.com/p2HhbbSa

Enjoy
salacious necrosis
Garoun Investment Bank
Gallente Federation
#2 - 2017-03-02 01:01:27 UTC
Bender Bending wrote:
This took me over 24 hours to create, mainly because I'm still learning but also because I suck at scripting.
Anyway, I don't know who else will need this but a google search revealed the same question the forums a few times.

Plain text: http://pastebin.com/gRT9KbGB

JSON: http://pastebin.com/p2HhbbSa

Enjoy


Isn't this just metaGroupID = 5 in the SDE? If so, this should get you the list of type IDs (on Linux):


curl -s -X GET --header 'Accept: application/json' 'https://evekit-sde.orbital.enterprises/20170216/api/ws/v20170216/inv/meta_type?contid=-1&maxresults=1000&metaGroupID=%7B%20values%3A%20%5B5%5D%20%7D'


If you use jq you can extract just the type IDs with something like this:


curl -s -X GET --header 'Accept: application/json' 'https://evekit-sde.orbital.enterprises/20170216/api/ws/v20170216/inv/meta_type?contid=-1&maxresults=1000&metaGroupID=%7B%20values%3A%20%5B5%5D%20%7D' | jq '.[] | .typeID'


I count 539 mods which seems to be more than in your list.

Here's a fancy one liner to get the list in your format on Linux:


curl -s -X GET --header 'Accept: application/json' 'https://evekit-sde.orbital.enterprises/20170216/api/ws/v20170216/inv/type?contid=-1&maxresults=1000&typeID=%7B%20values%3A%20%5B'$(curl -s -X GET --header 'Accept: application/json' 'https://evekit-sde.orbital.enterprises/20170216/api/ws/v20170216/inv/meta_type?contid=-1&maxresults=1000&metaGroupID=%7B%20values%3A%20%5B5%5D%20%7D' | jq '.[] | .typeID' | awk '{printf $1"," }' | sed -e 's/,$//g')'%5D%20%7D' | jq '.[] | .typeName, .typeID' | awk 'NR%2{printf "%s, ",$0;next;}1'


Use EveKit ! - Tools for EVE Online 3rd party development

salacious necrosis
Garoun Investment Bank
Gallente Federation
#3 - 2017-03-02 01:06:59 UTC
Oops, actually my one-liner only gets the first 500. So here's a fancy two liner instead:


curl -s -X GET --header 'Accept: application/json' 'https://evekit-sde.orbital.enterprises/20170216/api/ws/v20170216/inv/type?contid=-1&maxresults=1000&typeID=%7B%20values%3A%20%5B'$(curl -s -X GET --header 'Accept: application/json' 'https://evekit-sde.orbital.enterprises/20170216/api/ws/v20170216/inv/meta_type?contid=-1&maxresults=1000&metaGroupID=%7B%20values%3A%20%5B5%5D%20%7D' | jq '.[] | .typeID' | head -n 200 | awk '{printf $1"," }' | sed -e 's/,$//g')'%5D%20%7D' | jq '.[] | .typeName, .typeID' | awk 'NR%2{printf "%s, ",$0;next;}1'



curl -s -X GET --header 'Accept: application/json' 'https://evekit-sde.orbital.enterprises/20170216/api/ws/v20170216/inv/type?contid=-1&maxresults=1000&typeID=%7B%20values%3A%20%5B'$(curl -s -X GET --header 'Accept: application/json' 'https://evekit-sde.orbital.enterprises/20170216/api/ws/v20170216/inv/meta_type?contid=-1&maxresults=1000&metaGroupID=%7B%20values%3A%20%5B5%5D%20%7D' | jq '.[] | .typeID' | tail -n +200 | awk '{printf $1"," }' | sed -e 's/,$//g')'%5D%20%7D' | jq '.[] | .typeName, .typeID' | awk 'NR%2{printf "%s, ",$0;next;}1'


Use EveKit ! - Tools for EVE Online 3rd party development

Bender Bending
Royal Amarr Institute
Amarr Empire
#4 - 2017-03-02 02:40:11 UTC
Thanks for the advice, I am fairly new to 3rd party application dev.

I am in uni for software and i needed practice with my foreach loops, heres the script i wrote in PHP:



foreach ($officermodList as $key => $value) {
    foreach ($allmodList as $key2 => $value2) {
        if (strcmp($value['typeName'], $value2['typeName']) == 0){
            echo $value['typeName'] . ", " . $value2['typeID'];
        }
    }
}



Where $officermodList is a json formatted list of all the officer modules i could copy and paste from the market browser, and $allmodList is a json formatted list of every typeID and typeName in the game.
Althalus Stenory
Flying Blacksmiths
#5 - 2017-03-02 07:12:51 UTC
Bender Bending wrote:


foreach ($officermodList as $key => $value) {
    foreach ($allmodList as $key2 => $value2) {
        if (strcmp($value['typeName'], $value2['typeName']) == 0){
            echo $value['typeName'] . ", " . $value2['typeID'];
        }
    }
}



Since you never use "$key" and $"key2" you could also write :



foreach ($officermodList as $value) {
    foreach ($allmodList as $value2) {
        if (strcmp($value['typeName'], $value2['typeName']) == 0){
            echo $value['typeName'] . ", " . $value2['typeID'];
        }
    }
}

EsiPy - Python 2.7 / 3.3+ Swagger Client based on pyswagger for ESI

Bender Bending
Royal Amarr Institute
Amarr Empire
#6 - 2017-03-02 17:32:38 UTC
Thanks!