Creating a Statistic Website for Fansite

Greetings,

I am new to the forum! :slight_smile:
I have a couple of questions that may make this thread a little longer, I hope everyone is able to help me.

I want to create a website that pulls data from a server game (Grepolis). This data can show the activity of members/players, alliances, as well as inactivity, overall points, etc. Kind of like these 2 websites : Oracle of Zancle Grepolis Grepolis Intel

I know these websites pull the data from [quote]http://usX.grepolis.com/data/players.txt.gz[/quote] where I need to replace the ā€œXā€ with the number of the server I play in. For example: Players Data .txt.gz <ā€” Do not click unless you want to download :stuck_out_tongue:

US Grepolis Forum - Links to Servers Data

My problem is that I do not know how these websites do it, or even where to start.

Could anyone please share some of your knowledge on how to create this type of websites?

Thank you

ā€” Edit to add:
This a quote from US Grepolis Forum - Links to Servers Data, I am adding it here so you donā€™t have to open it and have more tabs open.

[QUOTE]To help developers of external sites statistics, we make available for download the data of the most important worlds. Player attributes, cities and alliances are thus available for download regularly. We also provide information on the conquests of the city from a world in UNIX timestamp and content profiles.

Load the data only when you need it in order not to overload the server query. Scripts loading the data more than once per hour are not allowed. It is best to host them on an external site in that case. Note that the data is updated at regular intervals based on the world selected.

The files are available in .txt.gz format and there are 11 in total. Each file consists of an arbitrary number of comma-separated lines. The data is encoded PHP format, which means that a comma is expressed by %.

For download, it is necessary to replace usX by the identification number of the desired world (us1 for Alpha , us2 for Beta , etc ā€¦)

http://usX.grepolis.com/data/players.txt.gz
This file contains information about the players. The data is available in the following order:
$ id, $ name, $ alliance_id, $ points, $ rank, $ towns

http://usX.grepolis.com/data/alliances.txt.gz
This file contains information about the alliances. The data is available in the following order:
$ id, $ name, $ points, $ village members $ $ rank

http://usX.grepolis.com/data/towns.txt.gz
This file contains information on cities. The data is available in the following order:
$ id, $ player_id, $ name, $ island_x $ island_y $ number_on_island, $ points

http://usX.grepolis.com/data/islands.txt.gz
This file contains information about the islands. The data is available in the following order:
$ id, $ x, $ y, $ island_type $ available_towns

http://usX.grepolis.com/data/player_kills_all.txt.gz
This file contains information on the classification of combatants. The data is available in the following order:
$ rank $ player_id, $ points

http://usX.grepolis.com/data/player_kills_att.txt.gz
This file contains information on the classification of attackers fighters. The data is available in the following order:
$ rank $ player_id, $ points

http://usX.grepolis.com/data/player_kills_def.txt.gz
This file contains information on the classification of defenders fighters. The data is available in the following order:
$ rank $ player_id, $ points

http://usX.grepolis.com/data/alliance_kills_all.txt.gz
This file contains information on the classification of alliances fighting. The data is available in the following order: $ rank, alliance_id, $ points

http://usX.grepolis.com/data/alliance_kills_att.txt.gz
This file contains information on the classification of alliances attacking fighters. The data is available in the following order:
$ rank $ alliance_id, $ points

http://usX.grepolis.com/data/alliance_kills_def.txt.gz
This file contains information on the classification of alliances fighting defenders. The data is available in the following order:
$ rank $ alliance_id, $ points

http://usX.grepolis.com/data/conquers.txt.gz
This file contains information on the cities taken from the opening of the world. The data is available in the following order:
Town_id $, $ time, $ new_player_id $ old_player_id $ new_ally_id $ old_ally_id $ town_points[/QUOTE]

Have you looked at the structure of these files ?

Yes, there is actually no structure, it is just a .txt file with the data of the server (depending on what I download: players, alliances, islands, etc). Here it is:

players.txt - This is the .txt from the link I put up.

[quote]2644255,nick32,505,4315,1
2921079,Sr.+Ghost,0,9737,0
2926543,griecia,0,9152,0
2927129,rfff,249,5439,1
2929897,neisa.o,221,7149,1
2927174,koskopolis,223,6103,1
2498059,Ramiro.L,368,0,9635,0
690779,Barbatus31,2352,1508,2
2928405,TPETO,197,8449,1[/quote]

It is a long list of players, I just copied a few.

If you understand well how the files are coded, it should not be too difficult to devise a Web app that exploits it.

You first need to get more comfortable with Xojo Web. Have you tried it yet ?

[quote=327479:@Michel Bujardet]If you understand well how the files are coded, it should not be too difficult to devise a Web app that exploits it.

You first need to get more comfortable with Xojo Web. Have you tried it yet ?[/quote]

The files are not coded, they are just .txt. My question is how can I make a website connect to this files? (not download them but pull the data). I do not want to exploit anything, have you visited the other websites I put as examples?

Sorry, I am not into games at all. But what I can tell you is that it is relatively easy to download the files to your app, and look at the data.

However, if you never designed such an app, you have a lot to discover yet.

Mark, text files can be structured and coded, and the example that you are showing does have a structure. It is a text file where each record contains several data elements.

For example: 2644255,nick32,,505,4315,1 seems to be data element 1, userid, data element 3 (empty), data element 4, data element 5, data element 6. That is the structured part. What do 2644255, 505, 4315 mean? that is the coded part. My interpretation of Michelā€™s points is that you need to understand what exactly is the structure of the data files, and what is the nature of each data element in order to manage the files and records correctly.

Lookup HTTPSocket and CURL to start understanding how you can retrieve the files from the servers. Take your time, you have much to learn.

The information in your first post now shows how the files are structured.
eg:
$ id, $ name, $ alliance_id, $ points, $ rank, $ towns
tells you that in this listā€¦
2644255,nick32,505,4315,1
2921079,Sr.+Ghost,0,9737,0

nick32 has an ID of 2644255
He has no alliance
He has 505 points, is ranked 4315, and manages 1 town.

To get that data, you might use HTTPSocket to GET the text file, and save it, or open it into memory
You would use SPLIT() on each line of data to turn the fields into array values, or you might import the data into a database.

You may select the top 10 rows based on towns or ranking, and show the data in a text box or list box on screen.

When you have a way to read all teh data, and select the bits you want, and display them on screen in a desktop app of your creation, then you might consider moving to the web edition, and creating a pretty ā€˜front endā€™ to display the same data

[quote=327504:@Jeff Tullin]The information in your first post now shows how the files are structured.
eg:
$ id, $ name, $ alliance_id, $ points, $ rank, $ towns
tells you that in this listā€¦
2644255,nick32,505,4315,1
2921079,Sr.+Ghost,0,9737,0

nick32 has an ID of 2644255
He has no alliance
He has 505 points, is ranked 4315, and manages 1 town.

To get that data, you might use HTTPSocket to GET the text file, and save it, or open it into memory
You would use SPLIT() on each line of data to turn the fields into array values, or you might import the data into a database.

You may select the top 10 rows based on towns or ranking, and show the data in a text box or list box on screen.

When you have a way to read all teh data, and select the bits you want, and display them on screen in a desktop app of your creation, then you might consider moving to the web edition, and creating a pretty ā€˜front endā€™ to display the same data[/quote]

thank you! this is what Iā€™ve been looking for. I knew about the structure of the numbers, I just donā€™t know how to put it in code or where to even start.

Should I use java for this, or Html?

Thanks!

Xojo offers a Web version.

Butā€¦

Have you ever coded ?

[quote=327534:@Michel Bujardet]Xojo offers a Web version.

Butā€¦

Have you ever coded ?[/quote]

I have done some scripting in lua, not expert stuff. I looked at a video on xojo webb butā€¦ I think this will be a challenge. I am reading now on html5 and java. I want to get there, it might take me more than a month though xD

https://xojo.com/learn This textbook gives you a great overview of programming basics and how they apply in Xojo.
You basically learn to program and use Xojo at the same time.

Itā€™s a great place to start.