API Access to the Modules on AMP

Started by tygre, August 19, 2021, 05:21:38

Previous topic - Next topic

tygre

Hi there!

I'm developing AmiModRadio, an Amiga program to automatically download, unarchive, and play modules for Amiga and I was wondering if I could add AMP as a source (with any and all due credits!)?

I think that I could call the simple URL http://amp.dascene.net/downmod.php?index= with a number but I'd like to be sure that it's something that's allowed and smiled upon and, second, that it's the best method to do so...

Cheers!
Tygre

Asle

Hi Tygre,

The URL cited is definitely a valid option that is "allowed and smiled upon". Hopefully you won't call it millions of times per second ... As for credit, you could say it's coming from AMP ? not much more to say, I guess, aside crediting the musician(s) behind any given music, of course :)
Regarding a "best practice", I know nothing about API and how it should behave. Calling an ID with downmod.php means that you know on your side, somehow, the metadata that comes with it. This URL gives nothing more than the file itself corresponding to the ID given. I have no idea how you would know the author(s) on your own nor how you would maintain this information. But then again, maybe you do or you don't need this information :)

Anything could be done on our side. Definitely. But I would need material, or best practices for that kind of thing. I understand it could mean "searching" at some point and I most definitely don't want to search for '*' .. ever :)

So, what do you have in mind, exactly ? I don't know your program so you'll have to take that into account in your reply :)

Cheers
Sylvain

tygre

Salut Sylvain !

Thank you so much for your swift, kind, and positive answer :)

No worries, I don't believe that there are millions of users of AmiModRadio right now ;)

So I could use http://amp.dascene.net/downmod.php?index= with a number but would it be possible for you to provide another API that returns the current total number of modules? Something like http://amp.dascene.net/totalnumbermods.php or http://amp.dascene.net/downmod.php?totalnumber so that AmiModRadio could then randomly pick a number between 1 and this total number of modules when calling http://amp.dascene.net/downmod.php?index=

Thanks in advance!
Tygre

Asle

Hi again,

Anything is possible at this point, I guess. However, I'm still stuck at finding out the basics of these API. See, aside the security concerns (which will have to be addressed at some point), there are all kind of questions regarding output format and the like.

I'm not sure shooting randomly with an ID is the thing to do. Many are not attributed anymore (dupe, mistake, etc.). Granted, it won't break anything, though.

There are also ID pointing of non-downloadable material (broken file, author's request, etc.). The URL listed should already handle that. I'm not sure of the output you get for the moment :)

Anyway, I won't be in a position to do anything any time soon for personal reasons. I'll discuss this with others and we'll see where this goes.

Cheers
Sylvain

tygre

Hi Sylvain!

Thanks for your reply!

Indeed, for AmiModRadio, it doesn't matter if a URL is broken or point to some resource other than a module: it will try to download it, if it can't, just moves on, then it will try to play it and, again, if it can't, just moves on :)

What I would need would just be a URL like "http://amp.dascene.net/totalnumbermods.php" that would return just a number, the max. number of "modules" (even if broken links, other types of documents, etc.) currently available. If doesn't even have to be a "proper" HTML file, just a number :D

What do you think?
Cheers!
Tygre

tygre

Happy new year!

Health and prosperity! :D

Asle

Hi Tygre,
All the best to you too !

I've been thinking about your request and figured that the "number of modules" is not useful to you. To shoot randomly within a valid range, you obviously need the highest ID attributed. Otherwise, you will missed tons of material.
Let me ask around about security concerns and come back to you.

Cheers
Sylvain

tygre

Hi Sylvain and thank you!

You're right: the highest ID would be the solution... Let me know  :)

Cheers!
Tygre

tygre

Hi Sylvain and all!

Just a gentle "bump" to move my request on top of your stack  ;D

Cheers!

Asle

Hi,

Just to report that Monty promised to come back to you about this topic but spare time has been difficult to come by.
Just be patient please.

Cheers
Sylvain

tygre

Hi Sylvain and all!
Thanks very much :)
Could Monty find the time to add some PHP function to return the highest ID or total number of modules?
Cheers!
Tygre