citation=$(xsel -po) DOI=$(wget "https://api.crossref.org/works?query.bibliographic=$citation" -O - | jshon -e message -e items -e 0 -e DOI -u) url=$(wget "https://sci-hub.tw/$DOI" -O - | pcregrep -o3 'src ?= ?"((https?:)?\/\/)?([^"]+.pdf)') evince https://$url