Skip to content

Instantly share code, notes, and snippets.

@aalemayhu
Last active August 29, 2015 14:20
Show Gist options
  • Save aalemayhu/1355e7fd1c639cf4a814 to your computer and use it in GitHub Desktop.
Save aalemayhu/1355e7fd1c639cf4a814 to your computer and use it in GitHub Desktop.
Fetch page as text file using the title for filename
#!/bin/sh
url="$1"
# http://stackoverflow.com/questions/11711339/getting-webpage-title-img-metadata-info-from-linux-terminal
title=$(wget $url -O - | grep \<title\>|sed "s/\<title\>\([^<]*\).*/\1/" | tr ' ' '_')
links -dump $url >> "$title".txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment