if (FALSE) {
## most of the example below will fail as they require a
## real modArchive API key. The key used in these example
## is just a dummy. See details on how to get a key
## in the section 'ModArchive API Key' in the manual.
## Search for the module that is also used as
## an example in this package:
search.results <- modArchive.search.mod("*_-_intro.mod",
size.filter = "0-99",
format.filter = "MOD",
api.key = "")
## apparently there are multiple modules in
## database that have '_-_intro' in their
## file name or title. Select the wanted
## module from the list (the one with the
## word 'protrackr' in the instrument names):
search.select <- subset(search.results,
grepl("protrackr", search.results$instruments))
## get the same details, but now only for
## the specific module based on its ModArchive ID:
modArchive.info(search.select$id, api.key = "")
## download the selected module from ModArchive.org:
mod <- modArchive.download(search.select$id)
## here's a randomly picked module from the ModArchive:
info.random <- modArchive.random.pick(api.key = "")
## use modArchive.view.by to list the 2nd page
## of MOD files that start with the letter 'A'
info.list <- modArchive.view.by("A", "view_by_list", "MOD",
page = 2,
api.key = "")
## list the modules of the artist with id number 89200:
artist.mods <- modArchive.view.by("89200", "view_modules_by_artistid",
format.filter = "MOD",
api.key = "")
## here's how you can list MOD files of a
## specific genre:
list.genre <- modArchive.search.genre("Chiptune", "MOD",
api.key = "")
## get module info for a specific hash code
mod.hash <- modArchive.search.hash("8f80bcab909f700619025bd7f2975749",
"")
## find modarchive artist info, search for artist name
## or artist id:
artist.list <- modArchive.search.artist("89200",
api.key = "")
## How many requests did I make this month?:
modArchive.request.count("")
## How many requests am I allowed to make each month?:
modArchive.max.requests("")
}
Run the code above in your browser using DataLab