From 6d0079e886048fe72eaee48fd29ca9bd10a1b5a5 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sat, 2 Jun 2018 19:57:45 -0500 Subject: [PATCH] Clean up published extraction --- src/helpers.cr | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/helpers.cr b/src/helpers.cr index 040f09fe..3205176f 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -224,12 +224,8 @@ def fetch_video(id, client) raise "Could not find date published" end - published = published.lchop("Published ") - published = published.lchop("Started streaming ") - published = published.lchop("Streamed live ") - published = published.lchop("Uploaded ") - published = published.lchop("on ") - published = published.lchop("Scheduled for ") + published = published.split(" ") + published = published[-3..-1].join(" ") if !published.includes?("ago") published = Time.parse(published, "%b %-d, %Y") else