baseURL = ""
}
}  
-- #################### AMPHIBIA and REPTILES ###############################
-- ================= Amphibian Species of the World (ASW6)
--Recommended citation: Frost, Darrel R. 2019. Amphibian Species of the World: an Online Reference. Version 6.0 (Date of access). Electronic Database accessible at http://research.amnh.org/herpetology/amphibia/index.html. American Museum of Natural History, New York, USA.
URL for family page: http://research.amnh.org/vz/herpetology/amphibia/Amphibia/Anura/Allophrynidae
baseURL = http://research.amnh.org/vz/herpetology/amphibia/
suffix = Amphibia/Anura/Allophrynidae
note: needs the whole hierarchy (except the superfamily which is optional)
Template for main taxonomic listing:
SEARCH http://research.amnh.org/vz/herpetology/amphibia/amphib/basic_search?basic_query=Atelopus&stree=&stree_id=
searchSuffix = amphib/basic_search?basic_query=Atelopus&stree=&stree_id=
SEARCH http://research.amnh.org/vz/herpetology/amphibia/content/search?taxon=Allophryn*&subtree=&subtree_id=&english_name=&author=&year=&country=
searchSuffix = /content/search?taxon=Allophryn*&subtree=&subtree_id=&english_name=&author=&year=&country=
minimul = /content/search?taxon=Allophryn*&subtree  
data.ASW6 ={
citationArgs = {
website ="Amphibian Species of the World, an Online Reference.",
version = "Version 6.0",
publisher = "American Museum of Natural History, New York",
['last1']="Frost", ['first1']="Darrel R.", ['author1-link']="Darrel R. Frost",
},
customArgs = { exclude = "taxon,species,genus,family, superfamily,1,2,3",
baseURL = "http://research.amnh.org/herpetology/amphibia/",
defaultSuffix = "index.html",
defaultTitle = "ASW Home"
}
}  
data.ASW6.species = function(genus, species, subspecies)  
-- search for genus+species
local title = "Search for taxon: " .. "*" .. genus .. " " .. species .. "*"  
--local search = ""?action=names&taxon="" -- old version (pre ASW6)
--local search = "amphib/basic_search?basic_query=" -- basic search
local search = "content/search?taxon=" -- guided search for taxon name  
local url = data.ASW6.customArgs['baseURL'] .. search -- .. genus .. '+AND+' .. species
.. '&quot;' .. genus .. '+' .. species .. '&quot;'
return title, url
end
data.ASW6.genus = function(genus)
return data.ASW6.taxon(genus) -- use genus as alias of taxon
end
data.ASW6.taxon = function(taxon)
local title = "Search for Taxon: " .. taxon
local url= data.ASW6.customArgs['baseURL'] .. "content/search?taxon=" .. taxon
return title, url
end
data.ASW6.family = function(family)
local order = data.ASW6.checkOrder(family)
local url= data.ASW6.customArgs['baseURL'] .. "Amphibia/" .. order .. "/" .. firstToUpper(family)
local title = firstToUpper(family)
return title, url
end
data.ASW6.checkOrder = function(family)  
local gymnophiona={ "Caeciliidae", "Chikilidae", "Dermophiidae", "Herpelidae", "Ichthyophiidae", "Grandisoniidae", "Indotyphlidae", "Rhinatrematidae", "Scolecomorphidae", "Siphonopidae", "Typhlonectidae" }
local caudata = { "Ambystomatidae", "Amphiumidae", "Cryptobranchidae", "Hynobiidae", "Plethodontidae", "Proteidae", "Rhyacotritonidae", "Salamandridae", "Sirenidae" }  
for k,v in pairs(caudata) do
if v == family then return "Caudata" end
end
for k,v in pairs(gymnophiona) do
if v == family then return "Gymnophiona" end
end  
return "Anura"
end  
--============================= AmphibiaWeb ===================================
-- Citation: AmphibiaWeb. 2019. <https://amphibiaweb.org> University of California, Berkeley, CA, USA. Accessed 27 Sep 2019.
Code:
---
data.amphibiaweb = {
citationArgs = {
website = "AmphibiaWeb",
publisher = "University of California, Berkeley",
--['editor1-last']="", ['editor1-first']="", ['editor1-link']="",
},
customArgs = { exclude = "taxon,species,genus,family,1,2,3",
baseURL = "https://amphibiaweb.org/",
defaultSuffix = "taxonomy/AW_FamilyPhylogeny.html",
defaultTitle = "AmphibiaWeb Family Taxonomy"
}
}
data.amphibiaweb.species = function (genus, species, subspecies)
local title = "*" .. genus .. " " .. species .. "*"
--https://amphibiaweb.org/cgi/amphib_query?where-genus=Altiphrynoides&where-species=malcolmi
local url = data.amphibiaweb.customArgs['baseURL'] .. "cgi/amphib_query?rel-genus=equals&where-genus="
.. genus .. "&rel-species=equals&where-species=" .. species
return title, url
end
data.amphibiaweb.genus = function (genus)
local title = "*" .. genus .. "*"
--https://amphibiaweb.org/cgi/amphib_query?where-genus=Altiphrynoides&where-species=malcolmi
local url = data.amphibiaweb.customArgs['baseURL'] .. "cgi/amphib_query?rel-genus=equals&where-genus="
.. genus .. "&include_synonymies=Yes&show_photos=Yes"
return title, url
end
data.amphibiaweb.family = function (family) -- if family use standardised url
local url = data.amphibiaweb.customArgs['baseURL'] .. "lists/" .. firstToUpper(templateArgs['family']) .. ".shtml"
local title = templateArgs['family']
return title, url
end  
--=========================== The Reptile Database
data.reptileDB = {
-- http://reptile-database.reptarium.cz/species?genus=Epacrophis&species=boulengeri
-- recommended citation: Uetz, P., Freed, P. & Hošek, J. (eds.) (2019) The Reptile Database, http://www.reptile-database.org, accessed [insert date here]
citationArgs = {
--website="reptile-database.org",
website="The Reptile Database",
['editor1-last']="Uetz", ['editor1-first']="P.", --['editor1-link']="Peter Uetz",
['editor2-last']="Freed", ['editor2-first']="P.",
['editor3-last']="Hošek", ['editor3-first']="J.",
--year=2019  
},
customArgs = { exclude = "taxon,species,genus,family,1,2,3",
baseURL = "http://reptile-database.reptarium.cz/"
}
}  
data.reptileDB.species = function(genus, species)
local title = "*" .. genus .. " " .. species .. "*"
--http://reptile-database.reptarium.cz/species?genus=Loxocemus&species=bicolor
local url = data.reptileDB.customArgs['baseURL'] .. "species?genus=" .. genus .. "&species=" .. species
return title, url
end
data.reptileDB.genus = function(genus)
local title = "*" .. genus .. "*"
--http://reptile-database.reptarium.cz/advanced_search?genus=Malayopython&submit=Search
local url = data.reptileDB.customArgs['baseURL'] .. "advanced_search?genus=" .. genus .. "&exact%5B0%5D=taxon&submit=search"
return title, url
end
data.reptileDB.family = function(family)
return data.reptileDB.taxon(family)
end
data.reptileDB.order = function(order)
return data.reptileDB.taxon(order)
end
data.reptileDB.taxon = function(taxon)
local title = taxon
--http://reptile-database.reptarium.cz/advanced_search?taxon=Viperidae&exact%5B0%5D=taxon&submit=Search
local url = data.reptileDB.customArgs['baseURL'] .. "advanced_search?taxon=" .. taxon .. "&exact%5B0%5D=taxon&submit=search"
return title, url
end  
--################################### BIRDS ########################################
--====================Handbook of the Birds of the World Alive (HBW Alive)==============
data.HBWalive = {
citationArgs = {
website="Handbook of the Birds of the World Alive",
publisher="Lynx Edicions"
},
customArgs = { exclude="order,family,genus,species,taxon,id,1",
baseURL = "https://www.hbw.com/",
defaultSuffix = "family/home",
defaultTitle = "Family | HBW Alive"  
}
}
--############################## HBW ALIVE #########################################
-- family and species entries have mix of common name and taxon name so cannot be prempted;
-- must use title + url (which uses default functions in this module)
data.HBWalive.order = function(order)
local title = "Order " .. firstToUpper(order)
--https://www.hbw.com/order/struthioniformes
local url = target.customArgs['baseURL'] .. "order/" .. order
return title, url
end  
--======================IOC World Bird List==========================
Gill, F & D Donsker (Eds). 2019. IOC World Bird List (v9.2). doi : 10.14344/IOC.ML.9.2.
Gill F, D Donsker & P Rasmussen (Eds). 2020. IOC World Bird List (v10.2). doi : 10.14344/IOC.ML.10.1.  
data.IOC = {
citationArgs = {
website="IOC World Bird List",