diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rwxr-xr-x | rhautoimport | 3 | ||||
-rwxr-xr-x | rhautoimport-eu | 12 |
5 files changed, 20 insertions, 7 deletions
@@ -26,7 +26,7 @@ endif .PHONY: clean distclean EXECUTABLE := rhautoimport -IMPORTER := btl dn er nw oi po rs ra tr wr +IMPORTER := btl dn er eu nw oi po rs ra tr wr EXECUTABLES := $(IMPORTER:%=$(EXECUTABLE)-%) all: $(EXECUTABLE) diff --git a/debian/changelog b/debian/changelog index 97b239a..aeb5199 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,15 @@ +rhautoimport (13-1) unstable; urgency=medium + + * added importer Economic Update + + -- Christian Pointner <equinox@helsinki.at> Fri, 03 Jun 2016 16:58:23 +0200 + rhautoimport (12-1) unstable; urgency=medium * added importer for Panoptikum * fixed some minor bugs for Ergo and Werkstatt-Radio - -- Christian Pointner <equinox@spreadspace.org> Thu, 02 Jun 2016 14:52:25 +0200 + -- Christian Pointner <equinox@helsinki.at> Thu, 02 Jun 2016 14:52:25 +0200 rhautoimport (11-1) unstable; urgency=medium diff --git a/debian/control b/debian/control index 937c0fd..873412d 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.9.5 Package: rhautoimport Architecture: all -Depends: ${misc:Depends}, adduser, libdate-calc-perl, libdatetime-format-strptime-perl, libfile-slurp-perl, libjson-maybexs-perl, librhrd-perl, liburi-perl, libwww-perl, libxml-feed-perl, perl, bsd-mailx +Depends: ${misc:Depends}, adduser, libdate-calc-perl, libdatetime-format-strptime-perl, libdatetime-format-iso8601-perl, libfile-slurp-perl, libjson-maybexs-perl, librhrd-perl, liburi-perl, libwww-perl, libxml-feed-perl, perl, bsd-mailx Description: Radio Helsinki automatic importer This a set of scripts to automagically import shows from various external sources. diff --git a/rhautoimport b/rhautoimport index b008a13..e1ac820 100755 --- a/rhautoimport +++ b/rhautoimport @@ -37,6 +37,9 @@ case "$1" in er) TITLE="Ergo" ;; + eu) + TITLE="Economic Update" + ;; nw) TITLE="netwatcher" ;; diff --git a/rhautoimport-eu b/rhautoimport-eu index b79eff8..a8a57aa 100755 --- a/rhautoimport-eu +++ b/rhautoimport-eu @@ -23,6 +23,7 @@ use strict; use Date::Calc; +use DateTime::Format::ISO8601; use URI::URL; use HTML::Entities; @@ -81,7 +82,6 @@ if(Date::Calc::Delta_Days(@broadcast_date, @today) <= 0) { my $id = sprintf("%04d-%02d-%02d", @import_date); my $bd = sprintf("%04d-%02d-%02d", @broadcast_date); -my $bdfile = sprintf("^%04d-?%02d-?%02d", @broadcast_date); print "looking for files after $bd in Audioboom Clips\n"; print " -> $API_URL\n"; @@ -109,9 +109,12 @@ for my $clip (@clips) { next unless $sum_title =~ /$titleexp/; my $recorded = $clip->{recorded_at}; - $recorded = '<unset>' unless (defined $recorded); - print " Title: $sum_title (Recorded: " . $recorded . ")\n"; - # TODO: check if recorded is after $bd + next unless (defined $recorded); + my $rdt = DateTime::Format::ISO8601->parse_datetime($recorded); + print " Title: $sum_title (Recorded: " . $rdt . ")\n"; + + my @recoreded_date = ($rdt->year, $rdt->month, $rdt->day); + next if(Date::Calc::Delta_Days(@broadcast_date, @recoreded_date) < 0); if (defined $clip->{description}) { $sum_text = decode_entities($clip->{description}); @@ -125,6 +128,7 @@ for my $clip (@clips) { my @path = $uri->path_components; $file = $path[-1]; + last } if($uri eq "") { print "No Entry found from $bd - "; |