Mopolauta

Elasto Mania board
It is currently 15 Dec 2017, 13:08

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Elma Online API
PostPosted: 11 Jul 2011, 23:52 
Offline
Kuski
User avatar

Joined: 23 May 2002, 13:59
Posts: 6326
Location: In a northern danish city beating YOUR record.
It has always been my plan to do some sort of RSS feed from eol making it possible for contest holders and site admins to use data from eol on their sites. Giving the recent developments I've sped up this proces and can now present the first version of an EOL API, powered by an rss feed.

You can access the rss feed directly from http://.elmaonline.net/rss/ and input the level indices of the levels you want data from.

Or you can, which I would recommend, use the API Class for PHP I've made. It makes it easy to access the rss feed, set the different parameters and gives you the data in a nice array. You can download it from http://elmaonline.net/rss/rss.zip which includes an example PHP page which also has information about the different parameters you can set. It includes a method for verifying a specific time, and a method for getting times from any number of levels in an array.

(You can also access these links from the help page on the EOL site.)

There's not a lot of functionality yet, but there is the most basic stuff like times, nick, datetime and placement. You can improve on the class ofcourse but in most cases you would need an update in the RSS feed to get more information. I will probably improve on it, but if there's something specific you need feel free to ask for it.

I can see some people have been putting filename (like: snaab101) as level id, this is NOT how you should do it. If you want snaab101 you search for it on eol site and look at the url http://elmaonline.net/?s=stats&p=level&l=43329 and the last number after l= (43329) is the id that you should put into the code as levelid.

To get internals here is an array with the ids for internals.
$intid = array(1 => 2, 2 => 4, 3 => 5, 4 => 6, 5 => 7, 6 => 8, 7 => 9, 8 => 10, 9 => 15, 10 => 59, 11 => 78, 12 => 109, 13 => 139, 14 => 219, 15 => 71, 16 =>51, 17 => 165, 18 => 57, 19 => 128, 20 => 197, 21 => 43, 22 => 107, 23 => 98, 24 => 100, 25 => 175, 26 => 192, 27 => 38, 28 => 198, 29 => 31, 30 => 16, 31 => 18, 32 => 164, 33 => 66, 34 => 131, 35 => 156, 36 => 357, 37 => 45, 38 => 13, 39 => 408, 40 => 412, 41 => 24, 42 => 416, 43 => 415, 44 => 95, 45 => 29, 46 => 33, 47 => 46, 48 => 21, 49 => 52, 50 => 257, 51 => 135, 52 => 133, 53 => 413, 54 => 17);

So for example if you want apple harvest you give it levelid 17.

Please don't misuse it, for example don't have it read the times from eol everytime your pages is loaded, rather have it check for new times every once in a while and update those to your own db, or verify the times everytime someone uploads a new time. And know that you are being logged (only to know if people misuse it).

This should hopefully make it possible for external contests to survive. I will be adding this functionality to cupSource, Kopasite at some point.

_________________
Kopasite ^ 39 level packs and 1193 levels for your höyling pleasure
LaMe world of Kopa ^ Team LaMe
Elma Online ^ Moposite Records ^ Upload


Last edited by Kopaka on 28 Jan 2012, 15:56, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Elma Online API
PostPosted: 11 Jul 2011, 23:57 
Offline
Kuski
User avatar

Joined: 22 Aug 2005, 12:23
Posts: 2623
Location: Sweden, Gothemburg
This is great! And so are you!

Thanks a lot =) Keep up the good work!

_________________
Team HotHorses, and I'm converting to Icelandian now...


Top
 Profile  
 
 Post subject: Re: Elma Online API
PostPosted: 12 Jul 2011, 00:39 
Offline
Kuski
User avatar

Joined: 17 Aug 2002, 15:45
Posts: 1505
Location: on the roof
Yeah very good! I was just about thinking pming you to ask about the plans on this thing and now you post this. Gonna have a look at it how it works!

_________________
< roopemies> horror and frustrating and can't play, sounds just like you
Beer battle winner 2014 and 2015


Top
 Profile  
 
 Post subject: Re: Elma Online API
PostPosted: 13 Jul 2011, 00:54 
Offline
Kuski
User avatar

Joined: 17 Aug 2002, 15:45
Posts: 1505
Location: on the roof
RecSource now supports this. It is not possible to upload recs/times which cannot be verified from eol database.

_________________
< roopemies> horror and frustrating and can't play, sounds just like you
Beer battle winner 2014 and 2015


Top
 Profile  
 
 Post subject: Re: Elma Online API
PostPosted: 13 Jul 2011, 08:07 
Offline
Kuski
User avatar

Joined: 26 Dec 2007, 14:04
Posts: 328
Could it be possible to make an entry point to download lev-rec, and/or current battle-last winning rec (at least retrieve corresponding URLs) ?
Tell me if 'm asking impossible/unrelated features

_________________
tomorrow, I stop.


Top
 Profile  
 
 Post subject: Re: Elma Online API
PostPosted: 13 Jul 2011, 12:08 
Offline
Kuski

Joined: 29 May 2002, 08:03
Posts: 114
I dont get how the rss generating works. My feed is always empty. Could someone post an example? One with internals and one with externals.


Top
 Profile  
 
 Post subject: Re: Elma Online API
PostPosted: 13 Jul 2011, 12:19 
Offline
Kuski

Joined: 29 May 2002, 08:03
Posts: 114
klisse wrote:
I dont get how the rss generating works. My feed is always empty. Could someone post an example? One with internals and one with externals.


Found internal01 on this url http://beta.elmaonline.net/rss/?makerss=1&levelid=2


Top
 Profile  
 
 Post subject: Re: Elma Online API
PostPosted: 13 Jul 2011, 13:49 
Offline
Kuski
User avatar

Joined: 23 May 2002, 13:59
Posts: 6326
Location: In a northern danish city beating YOUR record.
Dunno if it's you klissse, but I can see some people have been putting filename (like: snaab101) as level id, this is NOT how you should do it. If you want snaab101 you search for it on eol site and look at the url http://beta.elmaonline.net/?s=stats&p=level&l=43329 and the last number after l= (43329) is the id that you should put into the code as levelid.

To get internals here is an array with the ids for internals.
$intid = array(1 => 2, 2 => 4, 3 => 5, 4 => 6, 5 => 7, 6 => 8, 7 => 9, 8 => 10, 9 => 15, 10 => 59, 11 => 78, 12 => 109, 13 => 139, 14 => 219, 15 => 71, 16 =>51, 17 => 165, 18 => 57, 19 => 128, 20 => 197, 21 => 43, 22 => 107, 23 => 98, 24 => 100, 25 => 175, 26 => 192, 27 => 38, 28 => 198, 29 => 31, 30 => 16, 31 => 18, 32 => 164, 33 => 66, 34 => 131, 35 => 156, 36 => 357, 37 => 45, 38 => 13, 39 => 408, 40 => 412, 41 => 24, 42 => 416, 43 => 415, 44 => 95, 45 => 29, 46 => 33, 47 => 46, 48 => 21, 49 => 52, 50 => 257, 51 => 135, 52 => 133, 53 => 413, 54 => 17);

So for example if you want apple harvest you give it levelid 17.

totem wrote:
Could it be possible to make an entry point to download lev-rec, and/or current battle-last winning rec (at least retrieve corresponding URLs) ?
Tell me if 'm asking impossible/unrelated features


I think so, but not completely sure what you're saying. Like give it a levelname/id and it gives you the url back that will download the lev/rec for that level?

_________________
Kopasite ^ 39 level packs and 1193 levels for your höyling pleasure
LaMe world of Kopa ^ Team LaMe
Elma Online ^ Moposite Records ^ Upload


Top
 Profile  
 
 Post subject: Re: Elma Online API
PostPosted: 13 Jul 2011, 17:35 
Offline
Kuski
User avatar

Joined: 26 Dec 2007, 14:04
Posts: 328
at least the possibility to give current battle lev URL, last battle lev URL, and last battle rec URL

_________________
tomorrow, I stop.


Top
 Profile  
 
 Post subject: Re: Elma Online API
PostPosted: 22 Jul 2011, 12:29 
Offline
Kuski

Joined: 19 Aug 2002, 16:54
Posts: 542
Location: denmark
Kopaka is the best \o/

_________________
Image ^_^


Top
 Profile  
 
 Post subject: Re: Elma Online API
PostPosted: 3 Feb 2014, 22:43 
Offline
Not banned
User avatar

Joined: 19 May 2002, 16:20
Posts: 2204
Location: omnipresent fractal hologram
I don't understand the usage of this. How is a program supposed to know the level id of a cup level? I can only do it by searching for the level on eol, and then copying the download link, and extract the id from the link.

(It's kind of strange to have an api for something that you have to do manually, if that is the only way.)

_________________
Elma 2 WR Thread
Elma 2 WR List
Elma 2 target times and youtube replays (iOS elma WRs)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group