Skip to content

Instantly share code, notes, and snippets.

@espadrine
Created March 18, 2012 20:06
Show Gist options
  • Save espadrine/2080717 to your computer and use it in GitHub Desktop.
Save espadrine/2080717 to your computer and use it in GitHub Desktop.
Get the definition of a french word from the command-line shell.
#!/bin/bash
# INSTALL: Put this in a shell script (eg, `~/bin/robert`).
# USE: `$ robert anticonstitutionnellement`.
wordId=$(curl "http://petitrobert.bvdep.com/list.asp?word=$1" \
-b "PR1Login=OK" 2>/dev/null \
| sed -En "/onload/{s/.*'([A-Z0-9]+)'.*/\1/
p
}")
open "http://petitrobert.bvdep.com/doc.asp?doc=$wordId" >/dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment