Created
December 15, 2016 15:45
-
-
Save morxa/265b3a432d0877e3c40a1fb7e72cda84 to your computer and use it in GitHub Desktop.
minkorrekt china gadgets
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 | |
# | |
# chinagadgets.bash | |
# Created: Thu 15 Dec 2016 15:53:11 CET | |
# Copyright 2016 Till Hofmann <[email protected]> | |
# | |
# This work is free. You can redistribute it and/or modify it under the | |
# terms of the Do What The Fuck You Want To Public License, Version 2, | |
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
# Short script to fetch all mentioned china gadgets from minkorrekt.de. | |
feedfile=$(mktemp) | |
curl -s http://minkorrekt.de/feed/mp3/ > $feedfile | |
episodes=$(grep \ | |
"<link>http://minkorrekt.de/\(minkorrekt\|methodisch\)" $feedfile |\ | |
sed "s:</\?link>::g") | |
echo """ | |
<html> | |
<body> | |
<meta charset="utf-8" /> | |
""" > chinagadgets.html | |
for episode in $episodes; do | |
episodenum=$(echo $episode | \ | |
grep -o -e "folge-\([0-9]\)*" | sed "s/folge-//" ) | |
chinagadget=$(curl -s $episode | grep -i china) | |
echo """ | |
<p> | |
<a href="$episode">Folge ${episodenum}:</a> | |
<br /> | |
$chinagadget | |
</p> | |
""" >> chinagadgets.html | |
done | |
echo """ | |
</body> | |
</html> | |
""" >> chinagadgets.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment