Last active
October 4, 2023 16:37
-
-
Save dewomser/cea719bec695d36d9e083d46ba13257a to your computer and use it in GitHub Desktop.
RSS-Feed der Stadt Worms als Drachen-Bubble
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ds=$(wget -qO- https://www.worms.de/de/aktuelles/rss.php) | |
for zeile in {1..5} | |
do | |
link=$(echo $ds | grep -E -o "<link>[[[:alnum:][:space:],-.:\"\/\„\“\-\<]*" |cut -b 7- | rev | cut -c 7- | rev |head -$((zeile+1)) |tail -1) | |
data=$(echo $ds | grep -E -o "DATA\[[[:alnum:][:space:],.:\"\/\„\“\-]*" |cut -b 6- |head -$zeile |tail -1) | |
cowsay -f dragon "$data;$link" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ds=$(wget -qO- https://www.worms.de/de/aktuelles/rss.php) | |
textarray=() | |
linkarray=() | |
for zeile in {1..5} | |
do | |
link=$(echo $ds | grep -E -o "<link>[[[:alnum:][:space:],-.:\"\/\„\“\-\<]*" |cut -b 7- | rev | cut -c 7- | rev |head -$((zeile+1)) |tail -1) | |
#link=$($ds | grep -E -o "<link>[[[:alnum:][:space:],-.:\"\/\„\“\-\<]*" |cut -b 7- | rev | cut -c 7- | rev |head -$((zeile+1)) |tail -1) | |
linkarray[$zeile]=$(echo $ds | grep -E -o "DATA\[[[:alnum:][:space:],.:\"\/\„\“\-]*" |cut -b 6- |head -$zeile |tail -1) | |
textarray[$zeile]="Die Stadt Worms.de hat einen informativen Rss-Feed. Hier kommt der Link zum Bild:" | |
echo "${textarray[$zeile]}" | |
echo $link | |
cowsay -f dragon "${linkarray[$zeile]}" | |
done | |
echo -n "Welcher Drache soll vertwittert werden: (1-5) " | |
read -n1 -r drache | |
cowsay -f dragon "${linkarray[$drache]}" | convert -background lightblue -fill blue -font Liberation-Mono-Bold -size '800x600' -trim label:@- drache.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Die 5 ersten Meldungen als Drachenbubble
Linux, Bash : Create a dragons bubble with rssfeed.
Funny cuts and greps