Skip to content

Instantly share code, notes, and snippets.

@underr
Created March 26, 2015 07:47
Show Gist options
  • Save underr/a39247f4bc955405bc24 to your computer and use it in GitHub Desktop.
Save underr/a39247f4bc955405bc24 to your computer and use it in GitHub Desktop.
#!/bin/bash
# exhentai image search 0.2 - reverse searches on exhentai for given image
# Requires xclip for copying into clipboard
# Copyleft 2014 - [email protected]
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program.
# If not, see http://www.gnu.org/licenses/.
FILE=$1
SHA1=`sha1sum $FILE | sed -e "s/$FILE//g"`
URL="http://exhentai.org/?fs_similar=1&fs_exp=1&f_shash=$SHA1"
if command -v xclip >/dev/null 2>&1; then
echo $URL | xclip -sel clip &&
echo "Copied to clipboard! Address is $URL"
else
echo "Address is $URL"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment