Author Topic: API Access to the Modules on AMP  (Read 1191 times)

Offline tygre

  • Newbie
  • *
  • Posts: 3
    • View Profile
API Access to the Modules on AMP
« on: August 19, 2021, 05:21:38 »
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

Offline Asle

  • Administrator
  • Hero Member
  • *****
  • Posts: 1 075
    • View Profile
    • Amiga Music Preservation
Re: API Access to the Modules on AMP
« Reply #1 on: August 19, 2021, 22:39:54 »
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

Offline tygre

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: API Access to the Modules on AMP
« Reply #2 on: September 02, 2021, 13:57:52 »
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

Offline Asle

  • Administrator
  • Hero Member
  • *****
  • Posts: 1 075
    • View Profile
    • Amiga Music Preservation
Re: API Access to the Modules on AMP
« Reply #3 on: September 06, 2021, 22:29:44 »
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

Offline tygre

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: API Access to the Modules on AMP
« Reply #4 on: November 15, 2021, 20:02:13 »
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