Class: Reve::API

Inherits:
Object show all
Defined in:
lib/reve.rb

Overview

API Class. Basic Usage: api = Reve::API.new('my_UserID', 'my_apiKey') alliances = api.alliances # Returns an array of Reve::Classes::Alliance

api.personal_wallet_blanace(:characterid => 892008733) # Returns an array of Reve::Classes::WalletBalance. Note that the CharacterID Number is required here.

api.sovereignty :just_hash => true # Returns the hash for this call with no Alliance data with it.

As of Revision 22 (28 August 2007) all API calls take a parameter, :just_hash, to just get the hash that represents that particular API call; No data related to the call is returned if :just_hash is present

All API methods have the functionality to read XML from an arbitrary location. This could be another webserver, or a XML file on disk. To use this pass the hash option :url => location where location is a String or URI class. See format_url_request documentation for more details.

Constant Summary

@@alliances_url =
'http://api.eve-online.com/eve/AllianceList.xml.aspx'
@@sovereignty_url =
'http://api.eve-online.com/map/Sovereignty.xml.aspx'
@@reftypes_url =
'http://api.eve-online.com/eve/RefTypes.xml.aspx'
@@skill_tree_url =
'http://api.eve-online.com/eve/SkillTree.xml.aspx'
@@member_tracking_url =
'http://api.eve-online.com/corp/MemberTracking.xml.aspx'
@@corporate_wallet_balance_url =
'http://api.eve-online.com/corp/AccountBalance.xml.aspx'
@@personal_wallet_balance_url =
'http://api.eve-online.com/char/AccountBalance.xml.aspx'
@@corporate_wallet_trans_url =
'http://api.eve-online.com/corp/WalletTransactions.xml.aspx'
@@personal_wallet_trans_url =
'http://api.eve-online.com/char/WalletTransactions.xml.aspx'
@@corporate_wallet_journal_url =
'http://api.eve-online.com/corp/WalletJournal.xml.aspx'
@@personal_wallet_journal_url =
'http://api.eve-online.com/char/WalletJournal.xml.aspx'
@@characters_url =
'http://api.eve-online.com/account/Characters.xml.aspx'
@@training_skill_url =
'http://api.eve-online.com/char/SkillInTraining.xml.aspx'
@@skill_queue_url =
'http://api.eve-online.com/char/SkillQueue.xml.aspx'
@@character_sheet_url =
'http://api.eve-online.com/char/CharacterSheet.xml.aspx'
@@starbases_url =
'http://api.eve-online.com/corp/StarbaseList.xml.aspx'
@@starbasedetail_url =
'http://api.eve-online.com/corp/StarbaseDetail.xml.aspx'
@@conqurable_outposts_url =
'http://api.eve-online.com/eve/ConquerableStationList.xml.aspx'
@@corporation_sheet_url =
'http://api.eve-online.com/corp/CorporationSheet.xml.aspx'
@@corporation_member_security_url =
'http://api.eve-online.com/corp/MemberSecurity.xml.aspx'
@@errors_url =
'http://api.eve-online.com/eve/ErrorList.xml.aspx'
@@map_jumps_url =
'http://api.eve-online.com/map/Jumps.xml.aspx'
@@map_kills_url =
'http://api.eve-online.com/map/Kills.xml.aspx'
@@personal_market_orders_url =
'http://api.eve-online.com/char/MarketOrders.xml.aspx'
@@corporate_market_orders_url =
'http://api.eve-online.com/corp/MarketOrders.xml.aspx'
@@personal_industry_jobs_url =
'http://api.eve-online.com/char/IndustryJobs.xml.aspx'
@@corporate_industry_jobs_url =
'http://api.eve-online.com/corp/IndustryJobs.xml.aspx'
@@personal_assets_url =
'http://api.eve-online.com/char/AssetList.xml.aspx'
@@corporate_assets_url =
'http://api.eve-online.com/corp/AssetList.xml.aspx'
@@personal_kills_url =
'http://api.eve-online.com/char/KillLog.xml.aspx'
@@corporate_kills_url =
'http://api.eve-online.com/corp/KillLog.xml.aspx'
@@character_id_url =
'http://api.eve-online.com/eve/CharacterID.xml.aspx'
@@character_name_url =

?names=CCP%20Garthagk ?ids=797400947

'http://api.eve-online.com/eve/CharacterName.xml.aspx'
@@personal_faction_war_stats_url =
'http://api.eve-online.com/char/FacWarStats.xml.aspx'
@@corporate_faction_war_stats_url =
'http://api.eve-online.com/corp/FacWarStats.xml.aspx'
@@general_faction_war_stats_url =
'http://api.eve-online.com/eve/FacWarStats.xml.aspx'
@@top_faction_war_stats_url =
'http://api.eve-online.com/eve/FacWarTopStats.xml.aspx'
@@faction_war_occupancy_url =
'http://api.eve-online.com/map/FacWarSystems.xml.aspx'
@@certificate_tree_url =
'http://api.eve-online.com/eve/CertificateTree.xml.aspx'
@@character_medals_url =
'http://api.eve-online.com/char/Medals.xml.aspx'
@@corporate_medals_url =
'http://api.eve-online.com/corp/Medals.xml.aspx'
@@corp_member_medals_url =
'http://api.eve-online.com/corp/MemberMedals.xml.aspx'
@@server_status_url =
'http://api.eve-online.com/Server/ServerStatus.xml.aspx'
@@research_url =
'http://api.eve-online.com/char/Research.xml.aspx'
@@personal_notification_url =
'http://api.eve-online.com/char/Notifications.xml.aspx'
@@personal_mailing_lists_url =
'http://api.eve-online.com/char/mailinglists.xml.aspx'
@@personal_mail_messages_url =
'http://api.eve-online.com/char/MailMessages.xml.aspx'
@@personal_contacts_url =
'http://api.eve-online.com/char/ContactList.xml.aspx'
@@corporate_contacts_url =
'http://api.eve-online.com/corp/ContactList.xml.aspx'
@@account_status_url =
'http://api.eve-online.com/account/AccountStatus.xml.aspx'
@@character_info_url =
'http://api.eve-online.com/eve/CharacterInfo.xml.aspx'

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (API) initialize(userid = "", key = "", charid = "")

Create a new API instance. current_time and cached_until are meaningful only for the LAST call made. Expects:

  • userid ( Integer | String ) - Your API userID

  • key ( String ) - Your API key (Full key or restricted key)

  • charid ( Integer | String ) - Default characterID for calls requiring it.

NOTE: All values passed to the constructor are typecasted to a String for safety.



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/reve.rb', line 129

def initialize(userid = "", key = "", charid = "")
  @userid = (userid || "").to_s
  @key    = (key    || "").to_s
  @charid = (charid || "").to_s
  
  @save_path = nil
  
  @max_tries = 3
  @timeout = 20

  @current_time = nil
  @cached_until = nil
  @last_hash = nil
  @reve_version = File.read(File.join(File.dirname(__FILE__),'../','VERSION')).chomp
  @http_user_agent = "Reve v#{@reve_version}; http://github.com/lisa/reve"
end

Instance Attribute Details

- (Object) cached_until (readonly)

Returns the value of attribute cached_until



120
121
122
# File 'lib/reve.rb', line 120

def cached_until
  @cached_until
end

- (Object) charid

Returns the value of attribute charid



118
119
120
# File 'lib/reve.rb', line 118

def charid
  @charid
end

- (Object) current_time (readonly)

Returns the value of attribute current_time



120
121
122
# File 'lib/reve.rb', line 120

def current_time
  @current_time
end

- (Object) http_user_agent

Returns the value of attribute http_user_agent



119
120
121
# File 'lib/reve.rb', line 119

def http_user_agent
  @http_user_agent
end

- (Object) key

Returns the value of attribute key



118
119
120
# File 'lib/reve.rb', line 118

def key
  @key
end

- (Object) last_hash (readonly)

Returns the value of attribute last_hash



120
121
122
# File 'lib/reve.rb', line 120

def last_hash
  @last_hash
end

- (Object) reve_version (readonly)

Returns the value of attribute reve_version



120
121
122
# File 'lib/reve.rb', line 120

def reve_version
  @reve_version
end

- (Object) save_path

Returns the value of attribute save_path



119
120
121
# File 'lib/reve.rb', line 119

def save_path
  @save_path
end

- (Object) timeout

Returns the value of attribute timeout



119
120
121
# File 'lib/reve.rb', line 119

def timeout
  @timeout
end

- (Object) userid

Returns the value of attribute userid



118
119
120
# File 'lib/reve.rb', line 118

def userid
  @userid
end

Instance Method Details

- (Object) account_status(opts = {})

Gets the status of the selected account. Returns Reve::Classes::AccountStatus



974
975
976
977
978
979
980
# File 'lib/reve.rb', line 974

def (opts = {})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@account_status_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@account_status_url,true,args)
  Reve::Classes::AccountStatus.new(xml.search('//result').first)
end

- (Object) alliances(opts = {})

Return a list of Alliances and member Corporations from api.eve-online.com/eve/AllianceList.xml.aspx Use the corporation_sheet method to get information for each member Corporation See also: Reve::Classes::Alliance, Reve::Classes::Corporation and corporation_sheet



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/reve.rb', line 207

def alliances(opts = {})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@alliances_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@alliances_url,true,args)
  alliances = []
  xml.search("/eveapi/result/rowset[@name='alliances']/row").each do |alliance|
    alliance_obj = Reve::Classes::Alliance.new(alliance)
    alliance.search("rowset[@name='memberCorporations']/row").each do |corporation|
      alliance_obj.member_corporations << Reve::Classes::Corporation.new(corporation)
    end
    alliances << alliance_obj
  end
  alliances
end

- (Object) certificate_tree(opts = {})

Returns a Reve::Classes::CertificateTree object that contains the Certificate tree structure. See the rdoc for Reve::Classes::CertificateTree for details. See also: Reve::Classes::CertificateTree



857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
# File 'lib/reve.rb', line 857

def certificate_tree(opts = {})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@certificate_tree_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@certificate_tree_url,true,args)
  
  tree = Reve::Classes::CertificateTree.new
  xml.search("/eveapi/result/rowset[@name=categories]/row").each do |category|
    cat = Reve::Classes::CertificateCategory.new(category)
    category.search("rowset[@name=classes]/row").each do |klass|
      kl = Reve::Classes::CertificateClass.new(klass)
      klass.search("rowset[@name=certificates]/row").each do |certificate|
        cert = Reve::Classes::Certificate.new(certificate)
        certificate.search("rowset[@name=requiredSkills]/row").each do |skill|
          cert.required_skills << Reve::Classes::CertificateRequiredSkill.new(skill)
        end
        certificate.search("rowset[@name=requiredCertificates]/row").each do |requiredcert|
          cert.required_certificates << Reve::Classes::CertificateRequiredCertificate.new(requiredcert)
        end
        kl.certificates << cert
      end
      cat.classes << kl
    end
    tree.categories << cat
  end
  tree
end

- (Object) character_info(opts = { :characterid => nil })

Gets the character info sheet for the selected Character Reve::Classes::CharacterInfo



984
985
986
987
988
989
990
# File 'lib/reve.rb', line 984

def character_info(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@character_info_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@character_info_url,true,args)
  Reve::Classes::CharacterInfo.new(xml.search('//result').first)
end

- (Object) character_medals(opts = { :characterid => nil })

Gets the list of Medals awarded to a Character. Returns a Reve::Classes::CharacterMedals object.



499
500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/reve.rb', line 499

def character_medals(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@character_medals_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@character_medals_url,true,args)
  current = xml.search("/eveapi/result/rowset[@name=currentCorporation]/row").inject([]) do |cur,elem|
    cur << Reve::Classes::CharacterMedal.new(elem)
  end
  other = xml.search("/eveapi/result/rowset[@name=otherCorporations]/row").inject([]) do |cur,elem|
    cur << Reve::Classes::CharacterMedal.new(elem)
  end
  Reve::Classes::CharacterMedals.new(current,other)
end

- (Object) character_name(opts = {})

Convert ids to Character names. Expects a Hash as a parameter with these keys:

  • ids ( Array ) - An Array of Character IDs to fetch the names of.

See Also: character_name, Reve::Classes::Character, character_sheet



193
194
195
196
197
198
199
# File 'lib/reve.rb', line 193

def character_name(opts = {})
  ids = opts[:ids] || []
  return [] if ids.empty?
  opts[:ids] = ids.join(',')
  compute_hash(  opts.merge(:url => @@character_name_url) ) ||
    process_query(Reve::Classes::Character,opts[:url] || @@character_name_url,false,opts)
end

- (Object) character_sheet(opts = { :characterid => nil })

Gets the CharacterSheet from api.eve-online.com/char/CharacterSheet.xml.aspx Expects:

  • characterid ( Fixnum ) - Get the CharacterSheet for this Character

See also: Reve::Classes::CharacterSheet



890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
# File 'lib/reve.rb', line 890

def character_sheet(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@character_sheet_url))
  return h if h
  
  xml = process_query(nil,opts[:url] || @@character_sheet_url,true,args)
  cs = Reve::Classes::CharacterSheet.new

  [ Reve::Classes::IntelligenceEnhancer, Reve::Classes::MemoryEnhancer, Reve::Classes::CharismaEnhancer,
    Reve::Classes::PerceptionEnhancer, Reve::Classes::WillpowerEnhancer
  ].each do |klass|
    xml_attr = klass.to_s.split("::").last.sub("Enhancer",'').downcase + "Bonus"
    i = klass.new(xml.search("/eveapi/result/attributeEnhancers/#{xml_attr}").search("augmentatorName/").first.to_s,
                  xml.search("/eveapi/result/attributeEnhancers/#{xml_attr}").search("augmentatorValue/").first.to_s.to_i)
    cs.enhancers << i
  end

  [ 'characterID', 'name', 'race', 'bloodLine', 'gender','corporationName',
    'corporationID','balance', 'cloneName', 'cloneSkillPoints' 
  ].each do |field|
    cs.send("#{field.downcase}=",xml.search("/eveapi/result/#{field}/").first.to_s)
  end
  
  [ 'intelligence','memory','charisma','perception','willpower' ].each do |attrib|
    cs.send("#{attrib}=",xml.search("/eveapi/result/attributes/#{attrib}/").first.to_s.to_i) 
  end
  xml.search("rowset[@name=skills]/row").each do |elem|
    cs.skills << Reve::Classes::Skill.new(elem)
  end
  
  xml.search("rowset[@name=certificates]/row").each do |elem|
    cs.certificate_ids << elem['certificateID'].to_i
  end
  [ :corporationRolesAtHQ, :corporationRoles, :corporationRolesAtBase, :corporationRolesAtOther ].each do |role_kind|
    xml.search("rowset[@name=#{role_kind.to_s}]/row").each do |elem|
      cs.rsend(["#{role_kind}"], [:push,Reve::Classes::CorporateRole.new(elem)])
    end
  end
  
  xml.search("rowset[@name=corporationTitles]/row").each do |elem|
    cs.corporate_titles << Reve::Classes::CorporateTitle.new(elem)
  end
  
  cs
end

- (Object) characters(opts = {})

Returns a Character list for the associated key and userid from api.eve-online.com/account/Characters.xml.aspx See also: Reve::Classes::Character



648
649
650
651
652
653
# File 'lib/reve.rb', line 648

def characters(opts = {})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@characters_url))
  return h if h
  process_query(Reve::Classes::Character,opts[:url] || @@characters_url,false,args)
end

- (Object) conquerable_stations(opts = {}) Also known as: conqurable_stations

Returns a list of ConqurableStations and outposts from api.eve-online.com/eve/ConquerableStationList.xml.aspx See also: Reve::Classes::ConqurableStation



262
263
264
265
# File 'lib/reve.rb', line 262

def conquerable_stations(opts = {})
  compute_hash(  opts.merge(:url => @@conqurable_outposts_url) ) ||
      process_query(Reve::Classes::ConquerableStation, opts[:url] || @@conqurable_outposts_url, false)
end

- (Object) corporate_assets_list(opts = { :characterid => nil})

Get a list of the Corporate Assets. Pass the characterid of the Corporate member See also assets_list method



629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
# File 'lib/reve.rb', line 629

def corporate_assets_list(opts = { :characterid => nil})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporate_assets_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@corporate_assets_url,true,args)
  assets = []
  xml.search("/eveapi/result/rowset/row").each do |container|
    asset_container = Reve::Classes::AssetContainer.new(container)
    container.search("rowset[@name='contents']/row").each do |asset|
      asset_container.assets << Reve::Classes::Asset.new(asset)
    end
    assets << asset_container
  end
  assets
end

- (Object) corporate_contacts(opts = {:characterid => nil})

Returns a list of Reve::Classes::CorporateContact objects.



312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/reve.rb', line 312

def corporate_contacts(opts = {:characterid => nil})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporate_contacts_url))
  return h if h
  xml = process_query(nil, opts[:url] || @@corporate_contacts_url,true,args)
  contacts = []
  xml.search("/eveapi/result/rowset[@name='corporateContactList']/row").each do |corporate|
    contacts << Reve::Classes::CorporateContact.new(corporate)
  end
  xml.search("/eveapi/result/rowset[@name='allianceContactList']/row").each do |alliance|
    contacts << Reve::Classes::AllianceContact.new(alliance)
  end
  contacts
end

- (Object) corporate_faction_war_stats(opts = { :characterid => nil })

Gets the CorporateFactionWarStat for the Corporation a Character belongs to. Expects:

  • characterid ( Integer | String ) - Get this character's corp's CorporateFactionWarStat.

See Also Reve::Classes::CorporateFactionWarStat and personal_faction_war_stats



535
536
537
538
539
540
541
542
543
544
545
546
547
# File 'lib/reve.rb', line 535

def corporate_faction_war_stats(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporate_faction_war_stats_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@corporate_faction_war_stats_url,true,args)    
  elems = {}
  [ :factionID, :factionName, :enlisted, :pilots,
    :killsYesterday, :killsLastWeek, :killsTotal, :victoryPointsYesterday,
    :victoryPointsLastWeek, :victoryPointsTotal ].each do |elem|
      elems[elem.to_s] = xml.search("/eveapi/result/" + elem.to_s).first.inner_html
    end
  Reve::Classes::CorporateFactionWarParticpant.new(elems)
end

- (Object) corporate_industry_jobs(opts = {:characterid => nil})

Returns a list of Reve::Classes::CorporateIndustryJob objects.



296
297
298
299
300
301
# File 'lib/reve.rb', line 296

def corporate_industry_jobs(opts = {:characterid => nil})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporate_industry_jobs_url))
  return h if h
  process_query(Reve::Classes::CorporateIndustryJob, opts[:url] || @@corporate_industry_jobs_url,false,args)
end

- (Object) corporate_kills(opts = { :characterid => nil })

See the options for personal_kills



770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
# File 'lib/reve.rb', line 770

def corporate_kills(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporate_kills_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@corporate_kills_url,true,args)
  kills = []
  xml.search("/eveapi/result/rowset/row").each do |e|
    victim = Reve::Classes::KillVictim.new(e.search("victim").first) rescue next # cant find victim
    attackers = []
    losses = []
    e.search("rowset[@name='attackers']/row").each do |attacker|
      attackers << Reve::Classes::KillAttacker.new(attacker)
    end
    e.search("rowset[@name='items']/row").each do |lost_item|
      lost = Reve::Classes::KillLoss.new(lost_item)
      lost_item.search("rowset[@name='items']/row").each do |contained|
        lost.contained_losses << Reve::Classes::KillLoss.new(contained)
      end
      losses << lost
    end
    kills << Reve::Classes::Kill.new(e, victim, attackers, losses)      
  end
  kills
end

- (Object) corporate_market_orders(opts = {:characterid => nil})

Returns a list of Reve::Classes::MarketOrder objects for market orders that are up on behalf of a Corporation Pass the characterid of the Character of whose corporation to check for



280
281
282
283
284
285
# File 'lib/reve.rb', line 280

def corporate_market_orders(opts = {:characterid => nil})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporate_market_orders_url))
  return h if h
  process_query(Reve::Classes::CorporateMarketOrder, opts[:url] || @@corporate_market_orders_url, false, args)
end

- (Object) corporate_medals(opts = { :characterid => nil })

Get the medals a Corporation can give out. Returns a list of Reve::Classes::CorporateMedal objects. Expects:

  • characterid ( Integer | String ) - Get this Medals this Character's Corporation can give out

See also: Reve::Classes::CorporateMedal, Reve::Classes::Medal



476
477
478
479
480
481
# File 'lib/reve.rb', line 476

def corporate_medals(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporate_medals_url))
  return h if h
  process_query(Reve::Classes::CorporateMedal, opts[:url] || @@corporate_medals_url,false,args)
end

- (Object) corporate_member_medals(opts = { :characterid => nil })

Gets the medals the Corporation has given out. Returns a list of Reve::Classes::CorporateMemberMedal Expects:

  • characterid ( Integer | String ) - Get this Medals this Character's Corporation has given out

See also: Reve::Classes::CorporateMedal, Reve::Classes::Medal



489
490
491
492
493
494
# File 'lib/reve.rb', line 489

def corporate_member_medals(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corp_member_medals_url))
  return h if h
  process_query(Reve::Classes::CorporateMemberMedal, opts[:url] || @@corp_member_medals_url,false,args)
end

- (Object) corporate_member_security(opts = { :characterid => nil })



831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
# File 'lib/reve.rb', line 831

def corporate_member_security(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporation_member_security_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@corporation_member_security_url,true,args)

  cmc = Reve::Classes::CorporationMemberSecurity.new
  xml.search("/eveapi/result/rowset[@name=members]/row").each do |member|
    mem = Reve::Classes::CorporationMember.new(member)
    cmc.members << mem
    [:roles, :grantableRoles, :rolesAtHQ, :grantableRolesAtHQ, :rolesAtBase, :grantableRolesAtBase, :rolesAtOther, :grantableRolesAtOther].each do |rowset|
      member.search("/rowset[@name=#{rowset.to_s}]/row").each do |row|
        mem.rsend(["#{rowset}"], [:push,Reve::Classes::CorporateRole.new(row)])
      end
    end
    member.search("/rowset[@name=titles]/row").each do |row|
      mem.rsend([:titles], [:push,Reve::Classes::CorporateTitle.new(row)])
    end
  end
  cmc
end

- (Object) corporate_wallet_balance(opts = { :characterd => nil })

Gets one's corporate WalletBalance from api.eve-online.com/corp/AccountBalance.xml.aspx Expects:

  • characterid ( Integer | String ) - Look at WalletBalance objects from this Character's Corporation

See also: Reve::Classes::WalletBalance and personal_wallet_balance



408
409
410
411
412
413
# File 'lib/reve.rb', line 408

def corporate_wallet_balance(opts = { :characterd => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporate_wallet_balance_url))
  return h if h
  process_query(Reve::Classes::WalletBalance,opts[:url] || @@corporate_wallet_balance_url,false,args)
end

- (Object) corporate_wallet_journal(opts = {:accountkey => nil, :characterid => nil, :beforerefid => nil})

Gets one's own corporate WalletJournal list from api.eve-online.com/corp/WalletJournal.xml.aspx Expects:

  • account_key ( Integer | String ) - Account key (1000-1006) to look at.

  • characterid ( Integer | String ) - Look at WalletJournal objects from this Character's Corporation

  • beforerefid ( Integer | String ) - Gets a list of WalletTransaction objects from before this RefID.

See also: Reve::Classes::WalletJournal and personal_wallet_journal



451
452
453
454
455
456
# File 'lib/reve.rb', line 451

def corporate_wallet_journal(opts = {:accountkey => nil, :characterid => nil, :beforerefid => nil})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporate_wallet_journal_url))
  return h if h
  process_query(Reve::Classes::WalletJournal,opts[:url] || @@corporate_wallet_journal_url,false,args)
end

- (Object) corporate_wallet_transactions(opts = {:accountkey => nil, :characterid => nil, :beforerefid => nil})

Gets one's corporate WalletTransaction list from api.eve-online.com/corp/WalletTransactions.xml.aspx Expects:

  • account_key ( Integer | String ) - Account key (1000-1006) to look at.

  • characterid ( Integer | String ) - Look at WalletTransaction objects from this Character's Corporation

  • beforetransid ( Integer | String ) - Gets a list of WalletTransaction objects from before this Transaction ID.

See also: Reve::Classes::WalletTransaction and personal_wallet_transactions



437
438
439
440
441
442
# File 'lib/reve.rb', line 437

def corporate_wallet_transactions(opts = {:accountkey => nil, :characterid => nil, :beforerefid => nil})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporate_wallet_trans_url))
  return h if h
  process_query(Reve::Classes::CorporateWalletTransaction,opts[:url] || @@corporate_wallet_trans_url,false,args)
end

- (Object) corporation_sheet(opts = { :characterid => nil })

Gets the CorporationSheet from api.eve-online.com/corp/CorporationSheet.xml.aspx Expects:

  • Hash of arguments:

    • characterid ( Integer | String ) - Gets the CorporationSheet for this Character

    • corporationid ( Integer ) - If the characterid isn't passed then send the corporation's id

(See the alliances method for a list) to get the details of a Corporation that belongs to an Alliance. See also: Reve::Classes::CorporationSheet



802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
# File 'lib/reve.rb', line 802

def corporation_sheet(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@corporation_sheet_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@corporation_sheet_url,true,args)

  h = { 'graphicid' => 0, 'shape1' => 0, 'shape2' => 0, 'shape3' => 0, 'color1' => 0, 'color2' => 0, 'color3' => 0,  }
  h.keys.each { |k| h[k] = xml.search("//result/logo/" + k + "/").to_s.to_i }
   = Reve::Classes::CorporateLogo.new h
  
  wallet_divisions = xml.search("//result/rowset[@name='walletDivisions']/").collect { |k| k if k.kind_of? Hpricot::Elem } - [ nil ]
  divisions = xml.search("//result/rowset[@name='divisions']/").collect { |k| k if k.kind_of? Hpricot::Elem } - [ nil ]
  divisions.collect! { |d| Reve::Classes::CorporateDivision.new(d) }
  wallet_divisions.collect! { |w| Reve::Classes::WalletDivision.new(w) }
  
  # Map the XML names to our own names and assign them to the temporary 
  # hash +res+ to pass to Reve::Classes::CorporationSheet#new
  res = Hash.new
  { :corporationid => :id, :corporationname => :name, :ticker => :ticker, :ceoid => :ceo_id,
    :ceoname => :ceo_name, :stationid => :station_id, :stationname => :station_name,
    :description => :description, :url => :url, :allianceid => :alliance_id,
    :alliancename => :alliance_name, :taxrate => :tax_rate, :membercount => :member_count,
    :memberlimit => :member_limit, :shares => :shares }.each do |k,v|
    res[v] = xml.search("//result/#{k.to_s}/").first.to_s.strip
  end

  Reve::Classes::CorporationSheet.new res, divisions, wallet_divisions,   
end

- (Object) errors(opts = {})

Returns a list of API Errors



238
239
240
241
# File 'lib/reve.rb', line 238

def errors(opts = {})
  compute_hash(  opts.merge(:url => @@errors_url) ) || 
    process_query(Reve::Classes::APIError,opts[:url] || @@errors_url,false)
end

- (Object) faction_war_stats(opts = {})

Gets Faction-wide war stats. See also: Reve::Classes::EveFactionWarStat, Reve::Classes::FactionwideFactionWarParticpant, Reve::Classes::FactionWar



552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
# File 'lib/reve.rb', line 552

def faction_war_stats(opts = {} )
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@general_faction_war_stats_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@general_faction_war_stats_url,true,args)
  participants = xml.search("/eveapi/result/rowset[@name='factions']/row").collect do |faction|
    Reve::Classes::FactionwideFactionWarParticpant.new(faction)
  end
  wars = xml.search("/eveapi/result/rowset[@name='factionWars']/row").collect do |faction_war|
    Reve::Classes::FactionWar.new(faction_war)
  end
  totals = {}
  [ :killsYesterday, :killsLastWeek, :killsTotal, :victoryPointsYesterday,
    :victoryPointsLastWeek, :victoryPointsTotal ].each do |elem|
    totals[elem.to_s] = xml.search("/eveapi/result/totals/" + elem.to_s).first.inner_html
  end
  Reve::Classes::EveFactionWarStat.new(totals, wars, participants)
end

- (Object) faction_war_system_stats(opts = {}) Also known as: faction_war_occupancy

Returns the occupancy data for each System. See also: Reve::Classes::FactionWarSystemStatus



573
574
575
576
577
578
# File 'lib/reve.rb', line 573

def faction_war_system_stats(opts = {})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@faction_war_occupancy_url))
  return h if h
  process_query(Reve::Classes::FactionWarSystemStatus,opts[:url] || @@faction_war_occupancy_url,false,args)
end

- (Object) faction_war_top_stats(opts = {})

Gets a list of the top 10 statistics for Characters, Corporations and Factions in factional warfare. Read the notes on Reve::Classes::FactionWarTopStats.



583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
# File 'lib/reve.rb', line 583

def faction_war_top_stats(opts = {})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@top_faction_war_stats_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@top_faction_war_stats_url,true,args)
  template = { :yesterday_kills => "KillsYesterday", :last_week_kills => "KillsLastWeek", :total_kills => "KillsTotal",
               :yesterday_victory_points => 'VictoryPointsYesterday', :last_week_victory_points => 'VictoryPointsLastWeek', :total_victory_points => 'VictoryPointsTotal' }
  # Inject here to save 60 lines.
  characters = template.inject({}) do |h,(key,val)|
    klass = key.to_s =~ /kills/ ? Reve::Classes::CharacterFactionKills : Reve::Classes::CharacterFactionVictoryPoints
    h[key] = pull_out_top_10_data(xml,klass,'characters',val)
    h
  end
  corporations = template.inject({}) do |h,(key,val)|
    klass = key.to_s =~ /kills/ ? Reve::Classes::CorporationFactionKills : Reve::Classes::CorporationFactionVictoryPoints
    h[key] = pull_out_top_10_data(xml,klass,'corporations',val)
    h
  end
  factions = template.inject({}) do |h,(key,val)|
    klass = key.to_s =~ /kills/ ? Reve::Classes::FactionKills : Reve::Classes::FactionVictoryPoints
    h[key] = pull_out_top_10_data(xml,klass,'factions',val)
    h
  end
  Reve::Classes::FactionWarTopStats.new(characters,corporations,factions)
end

- (Object) map_jumps(opts = {})

Returns a list of the number of jumps for each system. If there are no jumps for a system it will not be included. See also Reve::Classes::MapJump



225
226
227
228
# File 'lib/reve.rb', line 225

def map_jumps(opts = {})
  compute_hash(  opts.merge(:url => @@map_jumps_url) ) ||
    process_query(Reve::Classes::MapJump,opts[:url] || @@map_jumps_url,false)
end

- (Object) map_kills(opts = {})

Returns a list of the number of kills for each system. If there are no kills for a system it will not be included. See also Reve::Classes::MapKill



232
233
234
235
# File 'lib/reve.rb', line 232

def map_kills(opts = {})
  compute_hash(  opts.merge(:url => @@map_kills_url) ) ||
    process_query(Reve::Classes::MapKill,opts[:url] || @@map_kills_url,false)
end

- (Object) member_tracking(opts = {:characterid => nil})

Does big brother tracking from api.eve-online.com/corp/MemberTracking.xml.aspx Expects:

  • characterid ( Integer | String ) - Look at players in this Character's Corporation

See also: Reve::Classes::MemberTracking



371
372
373
374
375
376
# File 'lib/reve.rb', line 371

def member_tracking(opts = {:characterid => nil})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@member_tracking_url))
  return h if h
  process_query(Reve::Classes::MemberTracking,opts[:url] || @@member_tracking_url,false,args)
end

- (Object) names_to_ids(opts = {}) Also known as: character_id

Convert a list of names to their ids. Expects a Hash as a parameter with these keys:

  • names ( Array ) - An Array of Names to fetch the IDs of.

See Also: character_name, Reve::Classes::Character, character_sheet



172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/reve.rb', line 172

def names_to_ids(opts = {} )
  names = opts[:names] || []
  return [] if names.empty? # No names were passed.
  opts[:names] = names.join(',')
  args = postfields(opts)
  h = compute_hash(  opts.merge(:url => @@character_id_url) )
  return h if h
  xml = process_query(nil,opts[:url] || @@character_id_url, true,opts)
  ret = []
  xml.search("//rowset/row").each do |elem|
    ret << Reve::Classes::Character.new(elem)
  end
  ret
end

- (Object) personal_assets_list(opts = { :characterid => nil })

Get a list of personal assets for the characterid. See the Reve::Classes::Asset and Reve::Classes::AssetContainer classes for attributes available.



612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
# File 'lib/reve.rb', line 612

def personal_assets_list(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_assets_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@personal_assets_url,true,args)
  assets = []
  xml.search("/eveapi/result/rowset[@name='assets']/row").each do |container|
    asset_container = Reve::Classes::AssetContainer.new(container)
    container.search("rowset[@name='contents']/row").each do |asset|
      asset_container.assets << Reve::Classes::Asset.new(asset)
    end
    assets << asset_container
  end
  assets
end

- (Object) personal_contacts(opts = {:characterid => nil})

Returns a list of Reve::Classes::PersonalContact objects.



304
305
306
307
308
309
# File 'lib/reve.rb', line 304

def personal_contacts(opts = {:characterid => nil})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_contacts_url))
  return h if h
  process_query(Reve::Classes::PersonalContact, opts[:url] || @@personal_contacts_url,false,args)
end

- (Object) personal_faction_war_stats(opts = { :characterid => nil })

Gets the Reve::Classes::PersonalFactionWarStat for a character. Expects:

  • characterid ( Integer | String ) - Get this character's PersonalFactionWarStat.

See Also Reve::Classes::PersonalFactionWarStat and corporate_faction_war_stats



517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/reve.rb', line 517

def personal_faction_war_stats(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_faction_war_stats_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@personal_faction_war_stats_url,true,args)    
  elems = {}
  [ :factionID, :factionName, :enlisted, :currentRank, :highestRank, 
    :killsYesterday, :killsLastWeek, :killsTotal, :victoryPointsYesterday,
    :victoryPointsLastWeek, :victoryPointsTotal ].each do |elem|
      elems[elem.to_s] = xml.search("/eveapi/result/" + elem.to_s).first.inner_html
    end
  Reve::Classes::PersonalFactionWarParticpant.new(elems)
end

- (Object) personal_industry_jobs(opts = {:characterid => nil})

Returns a list of Reve::Classes::PersonalIndustryJob objects.



288
289
290
291
292
293
# File 'lib/reve.rb', line 288

def personal_industry_jobs(opts = {:characterid => nil})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_industry_jobs_url))
  return h if h
  process_query(Reve::Classes::PersonalIndustryJob, opts[:url] || @@personal_industry_jobs_url,false,args)
end

- (Object) personal_kills(opts = { :characterid => nil })

Get the last kills for the characterid passed. Expects:

  • Hash of arguments

    • characterid ( Integer ) - The Character whose Kills to retrieve

    • beforekillid ( Integer ) - (Optional) - Return the most recent kills before this killid.



744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
# File 'lib/reve.rb', line 744

def personal_kills(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_kills_url))
  return h if h
  xml = process_query(nil,opts[:url] || @@personal_kills_url,true,args)
  kills = []
  xml.search("/eveapi/result/rowset/row").each do |e|
    victim = Reve::Classes::KillVictim.new(e.search("victim").first) rescue next # cant find victim
    attackers = []
    losses = []
    e.search("rowset[@name='attackers']/row").each do |attacker|
      attackers << Reve::Classes::KillAttacker.new(attacker)
    end
    e.search("rowset[@name='items']/row").each do |lost_item|
      lost = Reve::Classes::KillLoss.new(lost_item)
      lost_item.search("rowset[@name='items']/row").each do |contained|
        lost.contained_losses << Reve::Classes::KillLoss.new(contained)
      end
      losses << lost
    end
    kills << Reve::Classes::Kill.new(e, victim, attackers, losses)      
  end
  kills
end

- (Object) personal_mail_messages(opts = { :characterid => nil })

Gets the characters notifications. Returns a list of Reve::Classes::MailMessage Expects:

  • characterid ( Integer | String ) - Get the MailMessages for this Character

See also: Reve::Classes::MailMessage



965
966
967
968
969
970
# File 'lib/reve.rb', line 965

def personal_mail_messages(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_mail_messages_url))
  return h if h
  process_query(Reve::Classes::MailMessage, opts[:url] || @@personal_mail_messages_url,false,args)
end

- (Object) personal_mailing_lists(opts = { :characterid => nil })

Gets the characters notifications. Returns a list of Reve::Classes::MailingList Expects:

  • characterid ( Integer | String ) - Get the MailingLists for this Character

See also: Reve::Classes::MailingList



953
954
955
956
957
958
# File 'lib/reve.rb', line 953

def personal_mailing_lists(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_mailing_lists_url))
  return h if h
  process_query(Reve::Classes::MailingList, opts[:url] || @@personal_mailing_lists_url,false,args)
end

- (Object) personal_market_orders(opts = {:characterid => nil})

Returns a list of Reve::Classes::MarketOrder objects for market orders that are up Pass the characterid of the Character to check for



271
272
273
274
275
276
# File 'lib/reve.rb', line 271

def personal_market_orders(opts = {:characterid => nil})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_market_orders_url))
  return h if h
  process_query(Reve::Classes::PersonalMarketOrder, opts[:url] || @@personal_market_orders_url, false, args)
end

- (Object) personal_notifications(opts = { :characterid => nil })

Gets the characters notifications. Returns a list of Reve::Classes::Notification Expects:

  • characterid ( Integer | String ) - Get the Notifications for this Character

See also: Reve::Classes::Notification



941
942
943
944
945
946
# File 'lib/reve.rb', line 941

def personal_notifications(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_notification_url))
  return h if h
  process_query(Reve::Classes::Notification, opts[:url] || @@personal_notification_url,false,args)
end

- (Object) personal_wallet_balance(opts = { :characterid => nil })

Gets one's own personal WalletBalance from api.eve-online.com/char/AccountBalance.xml.aspx Expects:

  • characterid ( Integer | String ) - Look at this player's WalletBalance

See also: Reve::Classes::WalletBalance and corporate_wallet_balance



396
397
398
399
400
401
# File 'lib/reve.rb', line 396

def personal_wallet_balance(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_wallet_balance_url))
  return h if h
  process_query(Reve::Classes::WalletBalance,opts[:url] || @@personal_wallet_balance_url,false,args)
end

- (Object) personal_wallet_journal(opts = { :characterid => nil, :beforerefid => nil})

Gets one's own personal WalletJournal list from api.eve-online.com/char/WalletJournal.xml.aspx Expects:

  • characterid ( Integer | String ) - Look at this player's WalletJournal list

  • beforerefid ( Integer | String ) - Gets a list of WalletJournal objects from before this RefID.

See also: Reve::Classes::WalletJournal and corporate_wallet_journal



464
465
466
467
468
469
# File 'lib/reve.rb', line 464

def personal_wallet_journal(opts = { :characterid => nil, :beforerefid => nil} )
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_wallet_journal_url))
  return h if h
  process_query(Reve::Classes::WalletJournal,opts[:url] || @@personal_wallet_journal_url,false,args)
end

- (Object) personal_wallet_transactions(opts = { :characterid => nil, :beforetransid => nil })

Gets one's own personal WalletTransaction list from api.eve-online.com/char/WalletTransactions.xml.aspx Expects:

  • characterid ( Integer | String ) - Look at this player's WalletTransaction list

  • beforetransid ( Integer | String ) - Gets a list of WalletTransaction objects from before this Transaction ID.

See also: Reve::Classes::WalletTransaction and corporate_wallet_transactions



422
423
424
425
426
427
# File 'lib/reve.rb', line 422

def personal_wallet_transactions(opts = { :characterid => nil, :beforetransid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@personal_wallet_trans_url) )
  return h if h
  process_query(Reve::Classes::PersonalWalletTransaction,opts[:url] || @@personal_wallet_trans_url,false,args)
end

- (Object) ref_types(opts = {})

Returns a RefType list (whatever they are) from api.eve-online.com/eve/RefTypes.xml.aspx See also: Reve::Classes::RefType



254
255
256
257
# File 'lib/reve.rb', line 254

def ref_types(opts = {})
  compute_hash(  opts.merge(:url => @@reftypes_url) ) || 
      process_query(Reve::Classes::RefType,opts[:url] || @@reftypes_url,false)
end

- (Object) research(opts = { :characterid => nil })

Gets one's research stats from agents api.eve-online/char/Research.xml.aspx Expects:

  • characterid ( Integer | String ) - Get stats for this Character

See also: Reve::Classes::Research



384
385
386
387
388
389
# File 'lib/reve.rb', line 384

def research(opts = { :characterid => nil })
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@research_url))
  return h if h
  process_query(Reve::Classes::Research,opts[:url] || @@research_url,false,args)      
end

- (Object) server_status(opts = {})

Get the server status of Tranquility as a Reve::Classes::ServerStatus object. See Also: Reve::Classes::ServerStatus



157
158
159
160
161
162
163
164
165
166
# File 'lib/reve.rb', line 157

def server_status(opts = {})
  args = postfields(opts)
  h = compute_hash(  opts.merge(:url => @@server_status_url) )
  return h if h
  xml = process_query(nil,opts[:url] || @@server_status_url,true,opts)
  Reve::Classes::ServerStatus.new(
    xml.search("/eveapi/result/serverOpen/").first.to_s,
    xml.search("/eveapi/result/onlinePlayers/").first.to_s
  )
end

- (Object) skill_in_training(opts = {:characterid => nil})

Gets the SkillInTraining from api.eve-online.com/char/SkillInTraining.xml.aspx Expects:

  • characterid ( Integer | String ) - Get the SkillInTraining for this Character

See also: Reve::Classes::SkillInTraining



660
661
662
663
664
665
666
667
668
669
670
671
672
# File 'lib/reve.rb', line 660

def skill_in_training(opts = {:characterid => nil})
  args = postfields(opts)
  ch = compute_hash(args.merge(:url => @@training_skill_url))
  return ch if ch
  h = {}
  xml = process_query(nil,opts[:url] || @@training_skill_url,true,args)
  xml.search("//result").each do |elem|
    for field in [ 'currentTQTime', 'trainingEndTime','trainingStartTime','trainingTypeID','trainingStartSP','trainingDestinationSP','trainingToLevel','skillInTraining' ]
      h[field] = (elem/field.intern).inner_html
    end
  end
  Reve::Classes::SkillInTraining.new(h)
end

- (Object) skill_queue(opts = {:characterid => nil})

Returns a list of Reve::Classes::QueuedSkill for characterid api.eve-online.com/char/SkillQueue.xml.aspx Expects:

  • characterid ( Integer | String ) - Get the QueuedSkill list for this character

See also Reve::Classes::QueuedSkill



679
680
681
682
683
684
# File 'lib/reve.rb', line 679

def skill_queue(opts = {:characterid => nil})
  args = postfields(opts)
  ch = compute_hash(args.merge(:url => @@skill_queue_url))
  return ch if ch
  process_query(Reve::Classes::QueuedSkill,opts[:url] || @@skill_queue_url,false,args)
end

- (Object) skill_tree(opts = {})

Returns the SkillTree from api.eve-online.com/eve/SkillTree.xml.aspx See also: Reve::Classes::SkillTree NOTE: This doesn't actually return a 'tree' yet.



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/reve.rb', line 331

def skill_tree(opts = {})
  h = compute_hash(opts.merge(:url => @@skill_tree_url) )
  return h if h
  doc = process_query(nil,opts[:url] || @@skill_tree_url,true)
  skills = []
  (doc/'rowset[@name=skills]/row').each do |skill|
    name = skill['typeName']
    type_id = skill['typeID']
    group_id = skill['groupID']
    rank = (skill/:rank).inner_html
    desc = (skill/:description).inner_html
    required_skills = []
    reqs = (skill/'rowset@name=[requiredskills]/row')
    reqs.each do |required|
      next if required.kind_of? Hpricot::Text # why is this needed? Why is this returned? How can I only get stuff with typeid and skilllevel?
      required_skills << Reve::Classes::SkillRequirement.new(required) if required['typeID'] && required['skillLevel']
    end
    required_attribs = []
    (skill/'requiredAttributes').each do |req|
      pri = doc.at(req.xpath + "/primaryAttribute")
      sec = doc.at(req.xpath + "/secondaryAttribute")
      required_attribs << Reve::Classes::PrimaryAttribute.new(pri.inner_html)
      required_attribs << Reve::Classes::SecondaryAttribute.new(sec.inner_html)
    end
    bonuses = []
    res = (skill/'rowset@name=[skillBonusCollection]/row')
    res.each do |bonus|
      next if bonus.kind_of? Hpricot::Text
      bonuses << Reve::Classes::SkillBonus.new(bonus) if bonus['bonusType'] && bonus['bonusValue']
    end
    skills << Reve::Classes::SkillTree.new(name,type_id,group_id,desc,rank,required_attribs,required_skills,bonuses)
  end
  skills
end

- (Object) sovereignty(opts = {})

Returns the Sovereignty list from api.eve-online.com/map/Sovereignty.xml.aspx See also: Reve::Classes::Sovereignty



246
247
248
249
# File 'lib/reve.rb', line 246

def sovereignty(opts = {})
  compute_hash(  opts.merge(:url => @@sovereignty_url) ) || 
    process_query(Reve::Classes::Sovereignty,opts[:url] || @@sovereignty_url,false)
end

- (Object) starbase_details(opts = { :characterid => nil, :starbaseid => nil }) Also known as: starbase_fuel

Returns the starbase details for the Starbase whose item id is starbase_id api.eve-online.com/corp/StarbaseDetail.xml.aspx Expects:

  • characterid ( Integer | String ) - Get the Starbase associated wih this character's Corporation

  • starbaseid ( Integer ) - Get the fuel for this Starbase. This is the Starbase's itemid.

See also Reve::Classes::StarbaseDetails



704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
# File 'lib/reve.rb', line 704

def starbase_details(opts = { :characterid => nil, :starbaseid => nil })
  opts[:itemid] = opts.delete(:starbaseid)
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@starbasedetail_url))
  return h if h
  xml = process_query(Reve::Classes::StarbaseDetails,opts[:url] || @@starbasedetail_url, true, args)
  
  state = xml.search("/eveapi/result/state").inner_text
  state_timestamp = xml.search("/eveapi/result/stateTimestamp").inner_text
  online_timestamp = xml.search("/eveapi/result/onlineTimestamp").inner_text
  
  h = {'usageFlags' => 0, 'deployFlags' => 0, 'allowCorporationMembers' => 0, 'allowAllianceMembers' => 0, 'claimSovereignty' => 0}
  h.keys.each {|k| h[k] = xml.search("/eveapi/result/generalSettings/#{k}").inner_text }
  general_settings = Reve::Classes::StarbaseGeneralSettings.new(h)
  
  h = {'onStandingDrop' => 0, 'onStatusDrop' => 0, 'onAggression' => 0, 'onCorporationWar' => 0}
  h.keys.each {|k| h[k] = xml.search("/eveapi/result/combatSettings/#{k}") }
  combat_settings = Reve::Classes::StarbaseCombatSettings.new(h)
  
  fuel = []
  xml.search("/eveapi/result/rowset[@name='fuel']/row").each do |entry|
    fuel << Reve::Classes::StarbaseFuel.new(entry)
  end
  
  res = Hash.new
  { :state => :state, :stateTimestamp => :state_timestamp, :onlineTimestamp => :online_timestamp }.each do |k,v|
    res[v] = xml.search("/eveapi/result/#{k.to_s}/").first.to_s.strip
  end
  
  Reve::Classes::StarbaseDetails.new res, general_settings, combat_settings, fuel
end

- (Object) starbases(opts = { :characterid => nil})

Returns a list of Reve::Classes::Starbase for characterid's Corporation. api.eve-online.com/corp/StarbaseList.xml.aspx Expects:

  • characterid ( Integer | String ) - Get the Starbase list for this character's Corporation

See also Reve::Classes::Starbase



691
692
693
694
695
696
# File 'lib/reve.rb', line 691

def starbases(opts = { :characterid => nil})
  args = postfields(opts)
  h = compute_hash(args.merge(:url => @@starbases_url))
  return h if h
  process_query(Reve::Classes::Starbase,opts[:url] || @@starbases_url,false,args)
end