nvim-sourcer/lua/sourcer/init.lua

23 lines
522 B
Lua

local M = {}
function M.lookup()
local keywords = vim.fn.getreg("*") -- receive yanked text
local url = "https://dl.acm.org/action/doSearch?AllField=" .. keywords
print("Entering the function")
-- Setup a http socket and request
local command = string.format("curl -s '%s'", "https://nickr.eu")
-- Execute the curl command and capture its output
local handle = io.popen(command)
local response = handle:read("*a")
handle:close()
print("Test")
print(keywords)
print("Response: " .. response)
end
return M