Skip to content

Instantly share code, notes, and snippets.

@aprescott
Last active December 14, 2015 04:09
Show Gist options
  • Save aprescott/5026495 to your computer and use it in GitHub Desktop.
Save aprescott/5026495 to your computer and use it in GitHub Desktop.
Number of films logged in Letterboxd.
#!/bin/bash
USERNAME=your-username
# -----
film_for_year() {
output=$(curl -s "http://letterboxd.com/$1/films/diary/year/$2/" | grep -Eo '([0-9]+) films' | grep -Eo '[0-9]+')
if [ -z "$output" ]; then
echo "0"
else
echo "$output"
fi
}
for i in {2008..2012}; do
echo -n $i$'\t'
film_for_year "$USERNAME" $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment