1 # Contributor: Marq Schneider <queueRAM@gmail.com>
6 pkgdesc="Media Center TV Listings to XMLTV.xml for mythtv"
8 url="http://mc2xml.my3gb.com"
11 makedepends=('curl' 'gawk' 'sed' 'grep' 'vim')
13 source=(${pkgname}.md5)
14 md5sums=('d2843f5cb97d33f40315e72411c2b93e')
15 # The following are what the source and md5sums lines would look like
16 # if the download URL was constant
17 #source=(${pkgname}::http://mc2xml.yourfreehosting.net?h=ospocz6)
18 #md5sums=('4be0cafe399173b5033e3b8ef1ec3b4d')
21 # This is rather unorthodox but the page uses javascript to construct
22 # URLs using some key value that is generated when the page is generated
23 # It is either based on the time or has some timeout value.
24 # This command grabs the page data, pulls out the URL generating line,
25 # parses out the hex value to be 'unescaped' and converts it to ASCII
26 if [ ! -e "${srcdir}/${pkgname}" ]; then
27 __download_url=`curl -s ${url} | \
28 awk '/ Linux/,0' | \
29 grep -m 1 "unescape" | \
31 sed -e 's/[^0-9A-F]//g' | \
33 msg2 "Downloading ${__download_url}..."
34 curl -s -o "${srcdir}/${pkgname}" ${__download_url}
37 # manually check the md5sum
38 md5sum --quiet -c ${pkgname}.md5 || (error "Integrity checks failed." && false)
42 install -D -m 755 "${srcdir}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
45 # vim:set ts=2 sw=2 et: