Skip to content

Instantly share code, notes, and snippets.

@souzaonofre
Created June 14, 2014 21:10
Show Gist options
  • Save souzaonofre/1eed8b8db61bf8639157 to your computer and use it in GitHub Desktop.
Save souzaonofre/1eed8b8db61bf8639157 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
url="$1"; [ ${url} == "" ] && exit 1;
#
[[ "$(echo ${url} | egrep '^http[s]?\:\/\/\w+(\.\w+)?(\.\w+)?')" == "" ]] && exit 1;
#
bad_list='(http|www|org|com|edu|in|io|can|like|to|in|of|de|em|para)';
#
name_list=$(echo ${url} | \
sed -r "s/^http[s]?\:\/\///" | \
sed -r "s/[\/\.\?\&\;\-]|(\w+\=)/ /g" | \
sed -r "s/\s${bad_list}\s/ /g" | \
sed -r "s/\s[aeiou]\s/ /g");
#
#
echo $name_list;
#
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment