Created
July 26, 2014 21:29
-
-
Save silvasur/f139f29cc8ffbe6d3a96 to your computer and use it in GitHub Desktop.
Martina und Moritz Rezepte etwas besser druckbar aufbereiten
This file contains hidden or 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/sh | |
# Extrahieren von [Martina und Moritz](http://martinaundmoritz.wdr.de/) Rezepten | |
# und aufbereiten in etwas besser druckbaren Stil. | |
# Klappt vielleicht auch mit anderen WDR-Rezepten. | |
extract_and_style() { | |
echo '<html> | |
<head> | |
<meta charset="utf-8"/> | |
<style type="text/css"> | |
#stand, .hidden, #wfCont, #wf, .broadcastInfo, #socialBookmarks, .moreInfo, .illustrationCont, hr { | |
display: none; | |
} | |
h1 { | |
font-size: 10pt; | |
font-weight: normal; | |
} | |
h1 span { | |
display: block; | |
font-size: 18pt; | |
font-weight: bold; | |
} | |
</style> | |
</head> | |
<body>' | |
xmllint --xpath "//div[@id='mainColumn']" --html - | |
echo '</body></html>' | |
} | |
{ | |
if test $# -eq 0; then | |
extract_and_style | |
else | |
curl "$1" | extract_and_style | |
fi | |
} > /tmp/martinaundmoritz.html && open /tmp/martinaundmoritz.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment