Last active
August 29, 2015 14:23
-
-
Save AndreasBackx/76a42e4f65699435acd3 to your computer and use it in GitHub Desktop.
Auto upload Android screenshot to imgur and copy link to OSX clipboard.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imgur() { | |
for i in "$@"; do | |
curl -$# -F "image"=@"$i" -F "key"="4907fcd89e761c6b07eeb8292d5a9b2a" imgur.com/api/upload.xml | xmllint --xpath '/rsp/original_image/text()' - | pbcopy | |
echo "Successfully copied image to clipboard." | |
done | |
} | |
androidScreenshot() { | |
fileName=android-screenshot.png | |
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > $fileName | |
if [ $# -lt 1 ]; then | |
imgur $fileName | |
rm $fileName | |
else | |
open $fileName | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment