Add author for item

This commit is contained in:
Omar Roth 2018-02-26 20:59:18 -06:00
parent 3a95d21808
commit dff93f67f9
4 changed files with 14 additions and 2 deletions

View file

@ -273,6 +273,15 @@ get "/search" do |env|
end
end
author = root.xpath_node(%q(div[@class="yt-lockup-content"]/div/a))
if author
video["author"] = author.content
video["author_url"] = author["href"]
else
video["author"] = ""
video["author_url"] = ""
end
videos << video
end
end