Skip to content

Instantly share code, notes, and snippets.

@leonardodino
Created November 26, 2014 19:48
Show Gist options
  • Save leonardodino/91d6a66f63e47f597132 to your computer and use it in GitHub Desktop.
Save leonardodino/91d6a66f63e47f597132 to your computer and use it in GitHub Desktop.
webloc2png
# _ _
# | | | |
# | | ___ _ _ __ ___| |_
# | |/ / | | | '_ \/ __| __|
# | <| |_| | | | \__ \ |_
# |_|\_\\__,_|_| |_|___/\__|
# - - - - - - - - - - - - - -
# kunstdesign.com.br
# - - - - - - - - - - - - - -
# _ _ ___
# _ _ _ ___ | |_ | | ___ ___ |_ | ___ ___ ___
# | | | || -_|| . || || . || _|| _|| . || || . |
# |_____||___||___||_||___||___||___|| _||_|_||_ |
# v0.0.01 |_| |___|
#
# dependencies:
# 1. machintosh
# 2. homebrew
# 3. webkit2png ($ brew install webkit2png)
#
# versions:
# 1. direct copy & paste on workdir
# 2. save .sh script on workdir
#
# ENJOY!
# WTFPL LICENSE [http://www.wtfpl.net/txt/copying/]
#### copy & paste version #####
# 1. open terminal, cd to the folder with weblocs,
# 2. paste,
# 3. wait. (awesome)
webloc_download(){ \
local urlList=$(for f in *.webloc; do strings "$f" | grep \<string\> | sed s/\<\\/*string\>//g; done;); \
for url in $urlList; do webkit2png -W 1280 -H 800 -F "$url"& done; wait; \
}; \
webloc_download
#### webloc_download.sh #####
# 1. open terminal, cd to the folder with weblocs,
# 2. type nano webloc_download.sh
# 3. copy code below, paste with cmd+v
# 4. save with ctrl+o
# 5. exit with ctrl+x
# 6. run from shell ./webloc_download.sh
# 7. wait....
# (make sure you include the next line)
#!/usr/bin/env bash
urlList=$(for f in *.webloc; do strings "$f" | grep \<string\> | sed s/\<\\/*string\>//g; done;);
for url in $urlList; do webkit2png -W 1280 -H 800 -F "$url"& done; wait;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment