diff --git a/.gitignore b/.gitignore index e3cd4cd..e11a9df 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ Makefile /stamp-h1 src/afprint +scripts/puidlookup diff --git a/Makefile.am b/Makefile.am index ad55a1f..13aabb6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,4 +4,4 @@ MAINTAINERCLEANFILES= Makefile.in configure aclocal.m4 \ ACLOCAL_AMFLAGS= -I m4 AUTOMAKE_OPTIONS= dist-bzip2 no-dist-gzip std-options foreign EXTRA_DIST= autogen.sh -SUBDIRS = src . +SUBDIRS = src scripts . diff --git a/configure.ac b/configure.ac index 3ec4f79..33635f4 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,8 @@ AC_INIT([src/main.c]) VERSION_MAJOR=0 VERSION_MINOR=1 -VERSION_FULL="$VERSION_MAJOR.$VERSION_MINOR" +VERSION_MICRO=0 +VERSION_FULL="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_MICRO" VERSION="$VERSION_FULL" AC_SUBST([VERSION_MAJOR]) @@ -66,5 +67,7 @@ AM_CONFIG_HEADER(config.h) AC_OUTPUT( Makefile src/Makefile + scripts/Makefile + scripts/puidlookup ) dnl }}} diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 0000000..6560321 --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,3 @@ +CLEANFILES= puidlookup +SUBDIRS= . +bin_SCRIPTS= puidlookup diff --git a/scripts/puidlookup.in b/scripts/puidlookup.in new file mode 100644 index 0000000..47c6dbf --- /dev/null +++ b/scripts/puidlookup.in @@ -0,0 +1,84 @@ +#!/usr/bin/env bash +# vim: set sw=4 et sts=4 tw=80 : +# Copyright 2010 Ali Polatel +# Distributed under the terms of the GNU General Public License v2 + +# Constants +NAME="$(basename "${0}")" +VERSION="@VERSION@" +MUSICDNS_KEY="0a2cbb45cbbe7af5bf61ea5048d7f789" +MUSICDNS_URI="http://ofa.musicdns.org/ofa/1/track" +USER_AGENT="${NAME}/${VERSION}" + +# Functions +usage() { + cat <&2 + exit 1;; + esac +done + +IFS= read -r -d "${OPT_DELIM}" FILENAME +IFS= read -r -d "${OPT_DELIM}" DURATION +IFS= read -r -d "${OPT_DELIM}" FINGERPRINT +FINGERPRINT="${FINGERPRINT/$'\n'/}" +EXTENSION="${FILENAME##*.}" +post "${EXTENSION}" "${DURATION}" "${FINGERPRINT}" "${CURL_OPTS[@]}" +