dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README

commit 76eb42408cb9406b54945f30be0eb34cbf99c5c5
parent 118095108478dabd7c6e974a10058c0a9c8a9527
Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe>
Date:   Fri, 12 Jul 2024 20:32:33 -0500

.local/bin: added rae and wiki scripts

Diffstat:
A.local/bin/rae | 14++++++++++++++
A.local/bin/wiki | 5+++++
2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/.local/bin/rae b/.local/bin/rae @@ -0,0 +1,14 @@ +#!/bin/sh + +word=$(echo "$@" | sed 's/ /+/g') +response="$(curl -SsL "https://dle.rae.es/${word}" -H 'User-Agent: xyz')" + +echo "${response}" | awk ' + /<div id="resultados">Aviso:/ { print } + /^<article id="/ { flag = 1; next } + /^<\/article>/ { flag = 0 } + /Conjugar el verbo/ { next } + flag +' | elinks -dump -dump-color-mode 1 -no-references +printf "\x1b[0m" +#lynx -stdin -dump -color diff --git a/.local/bin/wiki b/.local/bin/wiki @@ -0,0 +1,5 @@ +#!/bin/sh +#https://es.wikipedia.org/w/rest.php/v1/search/page?q=etnocacerismo&limit=1 + +word=$(echo "$@" | sed 's/ /+/g') +curl -L "https://es.wikipedia.org/w/rest.php/v1/page/${word}" | jq -r .source