19 lines
447 B
Lua
19 lines
447 B
Lua
local M = {}
|
|
|
|
function M.lookup()
|
|
local keywords = vim.fn.getreg("") -- receive highlighted text
|
|
local url = "https://dl.acm.org/action/doSearch?AllField=" .. keywords
|
|
|
|
-- Setup a http socket and request
|
|
local http = require("socket.http")
|
|
local response, status_code, headers = http.request(url)
|
|
|
|
if status_code == 200 then
|
|
print(response)
|
|
else
|
|
print("Getting sources failed with error code " .. status_code .. "!")
|
|
end
|
|
end
|
|
|
|
return M
|