From a2e23f702217f8187ce738ee544f759cf89091a1 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Fri, 1 Jun 2018 17:24:16 -0500 Subject: Move author and ucid into schema --- src/helpers.cr | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/helpers.cr') diff --git a/src/helpers.cr b/src/helpers.cr index a88e9304..9375b3a6 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -76,6 +76,8 @@ class Video published: Time, description: String, language: String?, + author: String, + ucid: String, }) end @@ -194,8 +196,9 @@ def fetch_video(id, client) end title = info["title"] - views = info["view_count"].to_i64 + author = info["author"] + ucid = info["ucid"] likes = html.xpath_node(%q(//button[@title="I like this"]/span)) likes = likes.try &.content.delete(",").try &.to_i @@ -238,7 +241,7 @@ def fetch_video(id, client) end end - video = Video.new(id, info, Time.now, title, views, likes, dislikes, wilson_score, published, description, nil) + video = Video.new(id, info, Time.now, title, views, likes, dislikes, wilson_score, published, description, nil, author, ucid) return video end -- cgit v1.2.3