Forge of Empires (FoE) json response

09/12/2016 21:58 mrgoldy#1
Hello,

First of all, I hope I am posting in the correct forum, I'm a bit overwhelmed by the amount of forums and posts you've got. Congrats on the amount. If it's in the wrong area, feel free to move it.

Secondly, I'm looking on how to retrieve some data from the browser game Forge of Empires (FoE). I've been looking at a few of the bots I saw posted here but I couldn't figure out how these bots get their data or send any commands.

I am not looking to create another bot, just simply trying to read some data from the servers which would make it easier for me to run my guild and keep track of things.

Using the web console I've found that FoE uses the same link to POST their request per session. ([Only registered and activated users can see links. Click Here To Register...] [where x....x is the unique code]) However, when I enter this link into some code I've got running on a localhost I'm getting a 'NULL' response. Which figures, as when I enter the URL in my browser, it redirects me to the homepage of FoE.

My code being the following:
Code:
$url = "https://nl3.forgeofempires.com/game/json?h=xxxxxxxxxxxx";
$data2 = file_get_contents($url);
$data1 = json_decode($data2);

var_dump($data1);
* Where x...x is being replaced by the session code I am currently running

So can anyone point me in the right direction on how to read information of a specific FoE server? Any help/pointers would be appreciated!

Thanks in advance,
Kind regards,
09/12/2016 23:19 jessiesharp#2
you need to storage the cookies somewhere i think
09/12/2016 23:27 mrgoldy#3
Could you give me an example or link me to an example work on how it's done so I can have a look and play with it?
09/12/2016 23:30 jessiesharp#4
not writing in php but i think you should check this [Only registered and activated users can see links. Click Here To Register...]

or just check in others bots how its made
09/17/2016 16:48 Xavierbot#5
file_get_contents isn't made to do that.
You should use curl ([Only registered and activated users can see links. Click Here To Register...]).
With curl, you'll be able to manage your session (cookies ...)
09/27/2016 23:19 joueursuivant#6
Hi I'm doing a quite complete bot for FOE using picture recognition.
The english web site is not fully translated yet but documentation is translated and moreover, last release is nicely working (farming, managing PF, looking for treasures, ...)

You only need to have a java runtime.
Please enjoy and give me some feedback.
09/28/2016 19:57 Else#7
Quote:
Originally Posted by joueursuivant View Post
Hi I'm doing a quite complete bot for FOE using picture recognition.
The english web site is not fully translated yet but documentation is translated and moreover, last release is nicely working (farming, managing PF, looking for treasures, ...)

You only need to have a java runtime.
Please enjoy and give me some feedback.
Short: Pixelbot? Worthless. You can not detect the exact timestamp, eg.
09/28/2016 23:03 joueursuivant#8
It is more than a pixel bot it is a full picture recognition bot and it is more efficient and quicker.
But you are right, It cannot read tiemstamp but the bot knows when it launched a production so it know when to harvest it.
This knowledge is already in place in my bot but i still need to implement the OS task programmation to launch automaticaly the bot. (in verbose mode you could see lot of information about "tache" (task in french).

The mecanism is in place for treasures, material and ressources, and help function to do it only once a day.

please, let's test it and give me your feed back.

Regards
09/29/2016 20:08 Else#9
Quote:
Originally Posted by joueursuivant View Post
It is more than a pixel bot it is a full picture recognition bot and it is more efficient and quicker.
But you are right, It cannot read tiemstamp but the bot knows when it launched a production so it know when to harvest it.
This knowledge is already in place in my bot but i still need to implement the OS task programmation to launch automaticaly the bot. (in verbose mode you could see lot of information about "tache" (task in french).

The mecanism is in place for treasures, material and ressources, and help function to do it only once a day.

please, let's test it and give me your feed back.

Regards
Link?
09/29/2016 21:55 joueursuivant#10
[Only registered and activated users can see links. Click Here To Register...]

web site (mostly in english but not yet fully translated) : [Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]



I will be very please to get some feedback, and priority for next evolutions

why i cannot put a texte associated to an url !!!

installation package :

[Only registered and activated users can see links. Click Here To Register...]
10/06/2016 23:34 mrgoldy#11
Sounds great joueursuivant.
I've still been trying to connect to FoE Servers using php curl and bunch of other languages, but I am not succeeding.

So I am just wondering how I can connect to the servers to read out the server data.. Anyone could help with an example or set-up of that?
10/07/2016 14:48 Else#12
Quote:
Originally Posted by mrgoldy View Post
Sounds great joueursuivant.
I've still been trying to connect to FoE Servers using php curl and bunch of other languages, but I am not succeeding.

So I am just wondering how I can connect to the servers to read out the server data.. Anyone could help with an example or set-up of that?
What want you do with the example? Check maybe this [Only registered and activated users can see links. Click Here To Register...].