Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Reading speed in words per minute. Test at http://www.readingsoft.com/
- READSPEED=444
- PAGE="$(curl http://vlasisku.lojban.org/vlasisku/${1})"
- if [ "$(echo ${PAGE} | grep "I couldn't find you anything, sorry!" )" ]; then
- notify-send -i ${HOME}/.local/share/Lojban-Logo.svg "${1}" "No definition found."
- exit 1
- fi
- DEFINITION=$(echo "${PAGE}"|grep definition|sed 's/<\/p*>//'|sed 's/ <p class=\"definition\">//'|sed 's/<sub>//g'|sed 's/<\/sub>//g')
- RAFSI=$(echo "${PAGE}"|grep hyphen|sed 's/ <span class="hyphen">//g'|sed 's/<span class="hyphen">//g'|sed 's/<\/span>//g')
- i=0;
- for token in $DEFINITION; do
- i=$(($i + 1))
- done
- SECONDS=$(( $(( $(( $i / $(( $READSPEED / 60 )))) * 1000)) + 2000))
- notify-send -t ${SECONDS} -i ${HOME}/.local/share/Lojban-Logo.svg "${1} ${RAFSI}" "${DEFINITION}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement