Skip to content

Commit

Permalink
Update based on changes to Facebook html structure
Browse files Browse the repository at this point in the history
- Update scraping of likes based on html page structure
  • Loading branch information
treble37 committed Dec 12, 2016
1 parent 752a779 commit 52794a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/funky/html/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def extract_views_from(html)
end

def extract_likes_from(html)
html.match /"likecount":(.*?),/
matched_count $1
likes = html.to_enum(:scan, /"likecount":(.*?),/).map { Regexp.last_match }.last
likes.nil? ? "0" : likes[1]
end

def extract_comments_from(html)
Expand Down

0 comments on commit 52794a7

Please sign in to comment.