Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active October 4, 2023 16:37
Show Gist options
  • Save dewomser/cea719bec695d36d9e083d46ba13257a to your computer and use it in GitHub Desktop.
Save dewomser/cea719bec695d36d9e083d46ba13257a to your computer and use it in GitHub Desktop.
RSS-Feed der Stadt Worms als Drachen-Bubble
#!/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
#!/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
@dewomser
Copy link
Author

dewomser commented Dec 28, 2022


Die 5 ersten Meldungen als Drachenbubble

Linux, Bash : Create a dragons bubble with rssfeed.
Funny cuts and greps
Screenshot_20221228_091257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment