adding image retrieval

This commit is contained in:
mcguirepr89
2022-02-14 11:23:33 -05:00
parent 65dad0fbc3
commit 84bec4756f
4 changed files with 40 additions and 7 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# testing getting images dynamically
first_call=$(lynx -dump -listonly "https://commons.wikimedia.org/w/index.php?search=${1//_/+}&title=Special:MediaSearch&go=Go&type=image")
lynx -dump -listonly \
$(echo "$first_call" \
| sed '11q;d' \
| awk '{print $2}' ) \
| awk '/thumb/ {print $2}' \
| head -1 \
| xargs echo -n