Showing Posts For Doenerbude.9451:

Most recent dragon/temple/reward Event IDs

in API Development

Posted by: Doenerbude.9451

Doenerbude.9451

My list

$events = @{
Balthazar=“2555EFCB-2927-4589-AB61-1957D9CC70C8”;
Behemoth=“31CEBA08-E44D-472F-81B0-7143D73797F5”;
Fireelemental=“33F76E9E-0BB6-46D0-A3A9-BE4CDFC4A3A4”;
Golem=“9AA133DC-F630-4A0E-BB5D-EE34A2B306C2”;
Jormag=“0464CB9E-1848-4AAA-BA31-4779A959DD71”;
Megadestroyer=“C876757A-EF3E-4FBE-A484-07FF790D9B05”;
Tequatl=“568A30CF-8512-462F-9D67-647D69BEFAED”;
Shatterer=“03BF176A-D59F-49CA-A311-39FC6F533F2F”;
Modniir=“E6872A86-E434-4FC1-B803-89921FF0F6D6”;
Taidha=“242BD241-E360-48F1-A8D9-57180E146789”;
Jungleworm=“C5972F64-B894-45B4-BC31-2DEEA6B7C033”;
Dwayna=“7EF31D63-DB2A-4FEB-A6C6-478F382BFBCB”;
}

[API Suggestion] - Server/map stats.

in API Development

Posted by: Doenerbude.9451

Doenerbude.9451

1 and 2 you can do with the API. You have to monitor and save the events

Here some stats for Miller’s Sound (I store only the events of Miller cause it’s my home server.)

Numbers of Tequatl killed this month: 6
Time of last Tequatl kill: 01/26/2014 18:02:22 – 01/26/2014 18:22:01
Runtime: 19 Minutes 39 Seconds

Population on the map … I think it’s rather useless

Powershell and API's

in API Development

Posted by: Doenerbude.9451

Doenerbude.9451

I have made similar.
Since I have no idea of Java/PHP in conjunction with json, I let PowerShell call the API and write anything to the database. A small table simply shows the contents of the database. Is not live, but better than nothing: D

Script below
Let someone find something useful

##MySQL
$db_host = ‘host’
$db_name = ‘db-name’
$db_user = ‘db-user’
$db_pass = ‘db-pass’
$db_table = ‘db-table’

##Vars
$lang = ‘de’

##MySQL-Connect
[void][system.reflection.Assembly]::LoadFrom(“C:\Program Files (x86)\MySQL\MySQL Connector Net 6.5.4\Assemblies\v4.0\MySQL.Data.dll”)
$dbconnect = New-Object MySql.Data.MySqlClient.MySqlConnection
$dbconnect.ConnectionString = “server=$db_host;user id=$db_user;password=$db_pass;database=$db_name;pooling=false”
$dbconnect.Open()

$sql = New-Object MySql.Data.MySqlClient.MySqlCommand
$sql.Connection = $dbconnect

##World Events for 2206
$get = Invoke-WebRequest “https://api.guildwars2.com/v1/events.json?world_id=2206
$get = $get | ConvertFrom-Json

for($i = 0; $i -lt $get.events.count;$i++) {
$map_id = $get.events.map_id[$i]
$event_id = $get.events.event_id[$i]
$status = $get.events.state[$i]
$sql.CommandText = “INSERT INTO $db_table (map_id, event_id, status) values (‘$map_id’, ‘$event_id’, ‘$status’) ON DUPLICATE KEY UPDATE status=‘$status’”
$sql.ExecuteNonQuery()
}

##Event-Names (You have to do this once!)
$get = Invoke-WebRequest “https://api.guildwars2.com/v1/event_names.json?lang=$lang
$get = $get.Content | ConvertFrom-Json

for($i = 0; $i -lt $get.events.count;$i++) {
$event_id = $get.id[$i]
$event_name = $get.name[$i]
$sql.CommandText = “UPDATE $db_table SET `event_name` = ‘$event_name’ WHERE `event_id` = ‘$event_id’”
$sql.ExecuteNonQuery()
}

##Map-Names (You have to do this once!)
$get = Invoke-WebRequest “https://api.guildwars2.com/v1/map_names.json?lang=$lang
$get = $get.Content | ConvertFrom-Json

for($i = 0; $i -lt $get.events.count;$i++) {
$map_id = $get.id[$i]
$map_name = $get.name[$i]
$sql.CommandText = “UPDATE $db_table SET `map_name` = ‘$map_name’ WHERE `map_id` = ‘$map_id’”
$sql.ExecuteNonQuery()
}

$dbconnect.Close()