Skip to content

Instantly share code, notes, and snippets.

@OkashiOdayakana
Created December 16, 2016 02:17
Show Gist options
  • Save OkashiOdayakana/f050240271d331e6cc324df1b76251d1 to your computer and use it in GitHub Desktop.
Save OkashiOdayakana/f050240271d331e6cc324df1b76251d1 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -z "$key" ]
then
echo "Please enter your key"
read key
fi
echo "Please enter the URL you wish to shorten"
read url
result=$(curl "https://api.whats-th.is/shorten/polr?action=shorten&key=$key&url=$url")
echo $result | xclip -i -sel c -f |xclip -i -sel p
echo "Copied the link to the keyboard."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment