This simple shell script written in Ruby receives a Wikipedia URL as param, scrap it's content cleaning the paragraphs and returning them.
Its usefull to use by redirecting to a file or piping to Linux xclip
MacOS pbcopy
or WSL2 clip.exe
.
First give the execution permission to the script: chmod -x wikipedia_shell_script
Then run it providing the Wikipedia URL as param and pipe it to your clipboard app:
./wikipedia_shell_script https://pt.wikipedia.org/wiki/Ruby_\(linguagem_de_programa%C3%A7%C3%A3o\) | clip.exe
or just redirect to a file:
./wikipedia_shell_script https://pt.wikipedia.org/wiki/Ruby_\(linguagem_de_programa%C3%A7%C3%A3o\) > ruby.txt
In order to run this script you must have both Ruby and Nokogiri gem installed.