Skip to content

Instantly share code, notes, and snippets.

@ilyakava
Created August 2, 2015 12:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ilyakava/47aedca7bc39483d7a94 to your computer and use it in GitHub Desktop.
Save ilyakava/47aedca7bc39483d7a94 to your computer and use it in GitHub Desktop.
Input an arg of a file of a list of links, get an output.epub of all those webpages concatenated
#!/bin/bash
COUNT=1
for link in $(cat $1)
do
wget -O - -o /dev/null $link | iconv -f iso8859-1 -t utf-8 > $COUNT.html
COUNT=$(echo $COUNT + 1 |bc)
done
pandoc $(ls -1 *html | sort -n) -o output.epub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment