Skip to content

Commit

Permalink
Need CI to run rustfmt & stylua
Browse files Browse the repository at this point in the history
  • Loading branch information
frc4533-lincoln committed Oct 31, 2024
1 parent a3e5d5d commit d3be0f2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
9 changes: 9 additions & 0 deletions plugins/engines/algolia.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
local agent = 'Algolia for JavaScript (4.24.0)%3B Browser (lite)'

add_engine('algolia', function(client, query, opts)
assert(type(opts['application_id']) == 'string', 'application_id must be set')
assert(type(opts['api_key']) == 'string', 'api_key must be set')
assert(type(opts['distributed']) == 'boolean', 'distributed must be set')

--
end)
32 changes: 16 additions & 16 deletions plugins/engines/qwant.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ add_engine('qwant', function(client, query, opts)

local res = client:get(url, {})
local data = parse_json(res)
local mainline = data.data.result.items.mainline
local mainline = data.data.result.items.mainline

local results = {}
local i = 1
for _, item in ipairs(mainline) do
if item.type == 'web' then
for _, result in ipairs(item.items) do
results[i] = {
title = result.title,
url = result.url,
general = {
snippet = result.desc,
},
}
i = i + 1
end
end
end
local i = 1
for _, item in ipairs(mainline) do
if item.type == 'web' then
for _, result in ipairs(item.items) do
results[i] = {
title = result.title,
url = result.url,
general = {
snippet = result.desc,
},
}
i = i + 1
end
end
end

return results
end)

0 comments on commit d3be0f2

Please sign in to comment.