💾 Archived View for dimension.sh › ~textmonger › 2023-07-14-01-wikipedia-haste.gmi captured on 2023-07-22 at 16:20:06. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

2023-07-14 Wikipedia haste

Fri 14 Jul 2023 09:37:35 AM CDT

I threw these couple scripts together to quickly satisfy wondering what Wikipedia has per specified search/query terms.

"w" script: short for "wikipedia"

#! /usr/bin/env lua
if arg[1] then
	local query = 'https://en.wikipedia.org/w/index.php?search=' .. table.concat(arg, '%20') .. '~'
	if os.getenv('TERMINAL') then
		os.execute('el ' .. query)
	else
		os.execute('www-browser --client --url ' .. query)
	end
else
	print('=== missing query arguments')
end

NOTES:

- "el" (in "os.execute('el ' .. query)") is another script of mine wrapping 'elinks' for reason(s) I can't remember.

- "www-browser" is a command I discovered in my Chromebook's Linux environment (/usr/bin/www-browser) presented by the Chromebook "Terminal" app.

"wt" script: "w, but in the terminal instead of the graphical browser"

TERMINAL=y w $*

textmonger