You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
817 B
Bash

#!/bin/bash
## Convert PDF to text and send to Readability
## Written Nov 6, 2013
## Taha Ahmed
pdffile=$1
# Filename without extension part
jobname=${pdffile%.*}
txtfile=$jobname.txt
htmlfile=$jobname.html
#outfile=$jobname
# saves a HTML file in the current directory
pdftotext -htmlmeta $pdffile
# remove newlines from txtfile
#tr -d "\n" < $txtfile >
# copy the created txtfile to dropbox public folder
# and rename it to *.HTML
cp $htmlfile /home/taha/Dropbox/Public/$htmlfile
# construct the corresponding Dropbox public URL
htmlurl="https://dl.dropboxusercontent.com/u/47462551/$htmlfile"
# email url of htmlfile on dropbox to readability
#mail -s "dropbox2readability" chepec+simms@inbox.readability.com <<< $txturl
mail -t "chepec+simms@inbox.readability.com" -s "dropbox2readability" <<< $htmlurl