summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/luasocket/samples/cddb.lua
diff options
context:
space:
mode:
authorDenis Bitouzé <dbitouze@wanadoo.fr>2021-02-25 18:23:07 +0000
committerDenis Bitouzé <dbitouze@wanadoo.fr>2021-02-25 18:23:07 +0000
commitc6101f91d071883b48b1b4b51e5eba0f36d9a78d (patch)
tree1bf7f5a881d7a4f5c5bf59d0b2821943dd822372 /Build/source/texk/web2c/luatexdir/luasocket/samples/cddb.lua
parent07ee7222e389b0777456b427a55c22d0e6ffd267 (diff)
French translation for tlmgr updated
git-svn-id: svn://tug.org/texlive/trunk@57912 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luasocket/samples/cddb.lua')
-rw-r--r--Build/source/texk/web2c/luatexdir/luasocket/samples/cddb.lua46
1 files changed, 0 insertions, 46 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/samples/cddb.lua b/Build/source/texk/web2c/luatexdir/luasocket/samples/cddb.lua
deleted file mode 100644
index 49a187119f8..00000000000
--- a/Build/source/texk/web2c/luatexdir/luasocket/samples/cddb.lua
+++ /dev/null
@@ -1,46 +0,0 @@
-local socket = require("socket")
-local http = require("socket.http")
-
-if not arg or not arg[1] or not arg[2] then
- print("luasocket cddb.lua <category> <disc-id> [<server>]")
- os.exit(1)
-end
-
-local server = arg[3] or "http://freedb.freedb.org/~cddb/cddb.cgi"
-
-function parse(body)
- local lines = string.gfind(body, "(.-)\r\n")
- local status = lines()
- local code, message = socket.skip(2, string.find(status, "(%d%d%d) (.*)"))
- if tonumber(code) ~= 210 then
- return nil, code, message
- end
- local data = {}
- for l in lines do
- local c = string.sub(l, 1, 1)
- if c ~= '#' and c ~= '.' then
- local key, value = socket.skip(2, string.find(l, "(.-)=(.*)"))
- value = string.gsub(value, "\\n", "\n")
- value = string.gsub(value, "\\\\", "\\")
- value = string.gsub(value, "\\t", "\t")
- data[key] = value
- end
- end
- return data, code, message
-end
-
-local host = socket.dns.gethostname()
-local query = "%s?cmd=cddb+read+%s+%s&hello=LuaSocket+%s+LuaSocket+2.0&proto=6"
-local url = string.format(query, server, arg[1], arg[2], host)
-local body, headers, code = http.request(url)
-
-if code == 200 then
- local data, code, error = parse(body)
- if not data then
- print(error or code)
- else
- for i,v in pairs(data) do
- io.write(i, ': ', v, '\n')
- end
- end
-else print(error) end