From 7757523adb1e6356d6e6a2c3731bd5ef72c43637 Mon Sep 17 00:00:00 2001 From: mewmew Date: Sun, 25 Jan 2015 17:05:39 +0100 Subject: [PATCH] archive/ted/cmd/order: Use folders for ordered injection. --- archive/ted/cmd/inject/inject.go | 2 +- archive/ted/cmd/order/order.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/archive/ted/cmd/inject/inject.go b/archive/ted/cmd/inject/inject.go index db7f770..de14d88 100644 --- a/archive/ted/cmd/inject/inject.go +++ b/archive/ted/cmd/inject/inject.go @@ -26,7 +26,7 @@ func main() { func inject(talks []ted.Talk) { for _, talk := range talks { date := talk.Date.Format("2006-01") - fmt.Printf("wget -O \"%s - %s (%s) [%v]\" %s.mp4\n", date, talk.Title, talk.Event, talk.Duration, talk.Download) + fmt.Printf("wget -O \"%s - %s (%s) [%v].mp4\" %s\n", date, talk.Title, talk.Event, talk.Duration, talk.Download) } } diff --git a/archive/ted/cmd/order/order.go b/archive/ted/cmd/order/order.go index e160226..9f1dfe9 100644 --- a/archive/ted/cmd/order/order.go +++ b/archive/ted/cmd/order/order.go @@ -41,8 +41,9 @@ func order(talks []ted.Talk) { } defer f.Close() w = f + fmt.Fprintf(w, "mkdir -p %q\n", date) } - fmt.Fprintf(w, "wget -O \"%s - %s (%s) [%v].mp4\" %s\n", date, talk.Title, talk.Event, talk.Duration, talk.Download) + fmt.Fprintf(w, "wget -O \"%s/%s (%s) [%v].mp4\" %s\n", date, talk.Title, talk.Event, talk.Duration, talk.Download) prev = date } }