Method: Engagement::CommentCounter::HackerNews#comments_count
- Defined in:
- lib/engagement/comment_counter/hacker_news.rb
#comments_count(url) ⇒ Object
8 9 10 11 12 |
# File 'lib/engagement/comment_counter/hacker_news.rb', line 8 def comments_count(url) @client.search("items", url)['results'].inject(0) { |comments_count, result| comments_count + result['item']['num_comments'] } end |