Skip to content

Instantly share code, notes, and snippets.

@Cairnarvon
Created May 10, 2011 20:28
Show Gist options
  • Save Cairnarvon/965321 to your computer and use it in GitHub Desktop.
Save Cairnarvon/965321 to your computer and use it in GitHub Desktop.
Tineye bash script. Usage: ./tineye.sh image1.jpg [image2.jpg...]
#!/bin/bash
for f; do
if [ -f "$f" ]; then
TINURL=$(curl -s -F "image=@$f" http://www.tineye.com/search |
grep -E -o 'http://www.tineye.com/search/[0-9a-f]+/' |
head -n 1)
if [ -z "$TINURL" ]; then
echo "You have reached your daily search limit or something." >&2
else
x-www-browser $TINURL || www-browser $TINURL || echo $TINURL
fi
else
echo "File not found:" $f >&2
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment