Add 'commentCount' to '/comments/:id'

このコミットが含まれているのは:
Omar Roth 2018-07-22 12:15:18 -05:00
コミット dcf4330b35
1個のファイルの変更5行の追加0行の削除

ファイルの表示

@ -530,6 +530,11 @@ get "/comments/:id" do |env|
comments = JSON.build do |json|
json.object do
if body["header"]?
comment_count = body["header"]["commentsHeaderRenderer"]["countText"]["simpleText"].as_s.rchop(" Comments").delete(',').to_i
json.field "commentCount", comment_count
end
json.field "comments" do
json.array do
contents.as_a.each do |item|