Skip to content

Commit

Permalink
Fix cumulative view Count for non-English pages
Browse files Browse the repository at this point in the history
The text `views from this post` is only present if browsing Facebook
from an English-speaking country. The alternative is to find the
viewCount in a format like `pagesize:50,postViewCount:"6,585,065",shortenTi…`
  • Loading branch information
claudiob committed Jan 19, 2017
1 parent 883ad7c commit d60df22
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/funky/html/parser.rb
Expand Up @@ -22,6 +22,7 @@ def extract_views_from(html)
html.match(/<div><\/div><span class="fcg">\D*([\d,.]+)/)
html.match %r{([\d,.]*?) views from this post} if $1.nil?
html.match /<div class=\"_1vx9\"><span>([\d,.]*?) .*?<\/span><\/div>/ if $1.nil?
html.match(/postViewCount:"([\d,.]*?)",/) if $1.nil?
matched_count $1
end

Expand Down

0 comments on commit d60df22

Please sign in to comment.