Replace sockets
This commit is contained in:
parent
fad15fe78d
commit
a221f68c3b
|
@ -5,14 +5,14 @@ function M.lookup()
|
||||||
local url = "https://dl.acm.org/action/doSearch?AllField=" .. keywords
|
local url = "https://dl.acm.org/action/doSearch?AllField=" .. keywords
|
||||||
|
|
||||||
-- Setup a http socket and request
|
-- Setup a http socket and request
|
||||||
local http = require("socket.http")
|
local command = string.format("curl -s '%s'", url)
|
||||||
local response, status_code, headers = http.request(url)
|
|
||||||
|
|
||||||
if status_code == 200 then
|
-- Execute the curl command and capture its output
|
||||||
print(response)
|
local handle = io.popen(command)
|
||||||
else
|
local response = handle:read("*a")
|
||||||
print("Getting sources failed with error code " .. status_code .. "!")
|
handle:close()
|
||||||
end
|
|
||||||
|
print(reponse)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Reference in New Issue