# remove trailing text from beginning of script name
if (match(selector, ENVIRON["SCRIPT_NAME"])) {
- selector = substr(selector, 1, RSTART-1)
+ selector = substr(selector, 1, RSTART - 1)
}
selector = selector input
} else {
input = traversal
}
@@ -35,12 +35,12 @@
if (length(search) == 0 && match(input, /%09.*/)) {
# This is a hack to include a search in the URL.
# everything before %09 is considered arguments
# everything after %09 is considered the search
- search = substr(input, RSTART+3, RLENGTH-3)
- args = substr(input, 0, RSTART-1)
+ search = substr(input, RSTART + 3, RLENGTH - 3)
+ args = substr(input, 0, RSTART - 1)
} else {
args = input
}
# query is everything after ? in the gopher selector
@@ -51,11 +51,11 @@
path = selector
if (substr(path, 1, length(cgipath)) == cgipath) {
path = substr(path, length(cgipath) + 1)
}
if (match(path, /%09/)) {
- path = substr(path, 1, RSTART-1)
+ path = substr(path, 1, RSTART - 1)
}
# special case for when the search term is an archive.org details URL
if (match(search, /^https:\/\/(www\.)?archive\.org\/details\//)) {
- id = substr(search, RLENGTH+1)
+ id = substr(search, RLENGTH + 1)
search = "identifier:" id
}
# remove quotes from search string, since it gets quoted later
gsub(/"/, "", search)
@@ -87,11 +87,11 @@
split(order, parts, " ")
url = url sprintf("&sort%%5B0%%5D=%s %s", order_names[parts[1]],
parts[2])
}
for (i = 1; i <= fields; i++) {
- url = url sprintf("&fl%%5B%d%%5D=%s", i-1, field[i])
+ url = url sprintf("&fl%%5B%d%%5D=%s", i - 1, field[i])
}
api_request(url, "GET", iaout)