Skip to content

Commit

Permalink
updated to new EveScout Thera API
Browse files Browse the repository at this point in the history
  • Loading branch information
BitBaboonSteve committed Dec 2, 2023
1 parent aae5414 commit e88fe9f
Showing 1 changed file with 37 additions and 7 deletions.
44 changes: 37 additions & 7 deletions EVEData/EveManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2141,7 +2141,7 @@ public void UpdateIDsForMapRegion(string name)
/// </summary>
public async void UpdateTheraConnections()
{
string theraApiURL = "https://www.eve-scout.com/api/wormholes";
string theraApiURL = "https://api.eve-scout.com/v2/public/signatures?system_name=Thera";
string strContent = string.Empty;

try
Expand All @@ -2155,17 +2155,47 @@ public async void UpdateTheraConnections()

TheraConnections.Clear();

// JSON feed is now in the format : {"id":38199,"signatureId":"QRQ","type":"wormhole","status":"scanned","wormholeMass":"stable","wormholeEol":"critical","wormholeEstimatedEol":"2018-02-25T20:41:21.000Z","wormholeDestinationSignatureId":"VHT","createdAt":"2018-02-25T04:41:21.000Z","updatedAt":"2018-02-25T16:41:46.000Z","deletedAt":null,"statusUpdatedAt":"2018-02-25T04:41:44.000Z","createdBy":"Erik Holden","createdById":"95598233","deletedBy":null,"deletedById":null,"wormholeSourceWormholeTypeId":91,"wormholeDestinationWormholeTypeId":140,"solarSystemId":31000005,"wormholeDestinationSolarSystemId":30001175,"sourceWormholeType":
/*
new format
"id": "46",
"created_at": "2023-12-02T11:24:49.000Z",
"created_by_id": 93027866,
"created_by_name": "Das d'Alembert",
"updated_at": "2023-12-02T11:27:01.000Z",
"updated_by_id": 93027866,
"updated_by_name": "Das d'Alembert",
"completed_at": "2023-12-02T11:27:01.000Z",
"completed_by_id": 93027866,
"completed_by_name": "Das d'Alembert",
"completed": true,
"wh_exits_outward": true,
"wh_type": "Q063",
"max_ship_size": "medium",
"expires_at": "2023-12-03T04:24:49.000Z",
"remaining_hours": 14,
"signature_type": "wormhole",
"out_system_id": 31000005,
"out_system_name": "Thera",
"out_signature": "HMM-222",
"in_system_id": 30001715,
"in_system_class": "hs",
"in_system_name": "Moutid",
"in_region_id": 10000020,
"in_region_name": "Tash-Murkon",
"in_signature": "LPI-677"
*/

while (jsr.Read())
{
if (jsr.TokenType == JsonToken.StartObject)
{
JObject obj = JObject.Load(jsr);
string inSignatureId = obj["wormholeDestinationSignatureId"].ToString();
string outSignatureId = obj["signatureId"].ToString();
long solarSystemId = long.Parse(obj["wormholeDestinationSolarSystemId"].ToString());
string wormHoleEOL = obj["wormholeEol"].ToString();
string type = obj["type"].ToString();
string inSignatureId = obj["in_signature"].ToString();
string outSignatureId = obj["out_signature"].ToString();
long solarSystemId = long.Parse(obj["in_system_id"].ToString());
string wormHoleEOL = obj["expires_at"].ToString();
string type = obj["signature_type"].ToString();

if (type != null && type == "wormhole" && solarSystemId != 0 && wormHoleEOL != null && SystemIDToName.ContainsKey(solarSystemId))
{
Expand Down

0 comments on commit e88fe9f

Please sign in to comment.