Skip to content

Commit

Permalink
Merge pull request #39 from Fullscreen/tooltip-views
Browse files Browse the repository at this point in the history
Tooltip views
  • Loading branch information
claudiofullscreen committed Jun 7, 2016
2 parents 5092405 + 6a99b5e commit 09bb933
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,10 @@ For more information about changelogs, check
[Keep a Changelog](http://keepachangelog.com) and
[Vandamme](http://tech-angels.github.io/vandamme).

## 0.1.1 - 2016/06/07

* [BUGFIX] Added support for scraping view count from the new cumulative views that Facebook recently started rolling out.

## 0.1.0 - 2016/05/26

* [FEATURE] Added support for Facebook video data. Currently we can get the video id, length, description, created_time, picture, view_count, share_count, comment_count, and like_count.
1 change: 1 addition & 0 deletions lib/funky/html/parser.rb
Expand Up @@ -18,6 +18,7 @@ def extract_shares_from(html)

def extract_views_from(html)
html.match(/<div><\/div><span class="fcg">(.*) Views<\/span>/)
html.match(/id="u_0_n">(.*?) Views/) if $1.nil?
matched_count $1
end

Expand Down
2 changes: 1 addition & 1 deletion lib/funky/version.rb
@@ -1,3 +1,3 @@
module Funky
VERSION = "0.1.0"
VERSION = "0.1.1"
end
6 changes: 6 additions & 0 deletions spec/videos/video_spec.rb
Expand Up @@ -70,6 +70,12 @@
it { expect {video}.to raise_error(Funky::ContentNotFound) }
end

context 'given a video ID with the cumulative views was passed' do
let(:video_id) { '203203106739575' }

it { expect(video.view_count).to be_an(Integer) }
end

context 'given a SocketError' do
let(:video_id) { existing_video_id }
let(:socket_error) { SocketError.new }
Expand Down

0 comments on commit 09bb933

Please sign in to comment.