aboutsummaryrefslogtreecommitdiff
path: root/samples/cddb.lua
diff options
context:
space:
mode:
Diffstat (limited to 'samples/cddb.lua')
-rw-r--r--samples/cddb.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/samples/cddb.lua b/samples/cddb.lua
index d2e5b59..0ceba09 100644
--- a/samples/cddb.lua
+++ b/samples/cddb.lua
@@ -1,4 +1,5 @@
1require"http" 1socket = require("socket")
2http = require("http")
2 3
3if not arg or not arg[1] or not arg[2] then 4if not arg or not arg[1] or not arg[2] then
4 print("luasocket cddb.lua <category> <disc-id> [<server>]") 5 print("luasocket cddb.lua <category> <disc-id> [<server>]")
@@ -31,7 +32,7 @@ end
31local host = socket.dns.gethostname() 32local host = socket.dns.gethostname()
32local query = "%s?cmd=cddb+read+%s+%s&hello=LuaSocket+%s+LuaSocket+2.0&proto=6" 33local query = "%s?cmd=cddb+read+%s+%s&hello=LuaSocket+%s+LuaSocket+2.0&proto=6"
33local url = string.format(query, server, arg[1], arg[2], host) 34local url = string.format(query, server, arg[1], arg[2], host)
34local body, headers, code, error = socket.http.get(url) 35local body, headers, code, error = http.get(url)
35 36
36if code == 200 then 37if code == 200 then
37 local data, code, error = parse(body) 38 local data, code, error = parse(body)