#!/bin/bash
latestVersion="$(
curl 'http://git.videolan.org/?p=x264.git;a=shortlog;h=refs/heads/stable' 2> /dev/null | \
grep '[[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}' | \
sed "s|^.*\([[:digit:]]\{4\}\)-\([[:digit:]]\{2\}\)-\([[:digit:]]\{2\}\).*\$|\1\2\3|" | \
sort -n | \
tail -n1
)"
#latestVersion="$(\
# curl "http://ftp.videolan.org/pub/videolan/x264/snapshots/" 2> /dev/null | \
# tr "\"" "\n" | \
# grep "^x264-snapshot-[[:digit:]]\+-[[:digit:]]\+-stable.tar.bz2\$" | \
# sed "s/^x264-snapshot-\([[:digit:]]\+\)-[[:digit:]]\+-stable.tar.bz2\$/\1/" | \
# sort -n | \
# tail -n1)"
echo -n "${latestVersion}"