funky 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29d3fc3e6ab394df41e8aeb125c2f2f600123719
4
- data.tar.gz: 0efbe2dcb42052fc35c25a7385a6c8550db25d41
3
+ metadata.gz: 46500b4ee5d1c68792512b9cf131180960761e1f
4
+ data.tar.gz: 0a189efa28c00babc417f76508e6086d714143fe
5
5
  SHA512:
6
- metadata.gz: 82d8ddfb550c9b1799b082db00a61aecc9400e235347b49529db1f3402163343fa02d6d7d5cb1e3304b768c6e3b4fab96c5a84390d7dee1340e8875515b7ff5d
7
- data.tar.gz: bc8bdbb7b880a1ec83e6f2ef3140cd6840ccd1e3d6cdea3ee6ef87035776985f81f91b255fe5501b33ce81a49b75bfd91c48428448f793d193188bae85ccead0
6
+ metadata.gz: 6253eaff7e502716d92bd33c5147da6e57fbb400fc7ca7b0bffe8fd3862f738546563b8e7069aa74ae60ff174832951019998ebfd8393bab0d8ae84871acf56d
7
+ data.tar.gz: cd773bba9f1f366dee400e473d052bf8065c502eb8dd740e38a24ef2e7015fb293a58c35c6aa1869a5bbbc4ac177a38c7cf9f6f2f519d144e1fd3ef72a590bbd
@@ -3,3 +3,9 @@ rvm:
3
3
  - 2.3.1
4
4
  before_install: gem install bundler -v 1.12.3
5
5
  script: bundle exec rspec spec
6
+ # Note: environment variables are NOT accessible for PRs created from forks.
7
+ # Therefore PRs from forks will fail until the following issue is closed:
8
+ # https://github.com/travis-ci/travis-ci/issues/1946
9
+ env:
10
+ global:
11
+ secure: Ru7XMnp+0D3tqXJJKRivQHA/e76dhUS4zv9SAvcyzTeuELtn41PQ07r53lunz2t6btXuyRy5Cyr9DD7CnP+ocXbe7Ce6pl5i5gZ7R5KIeWgxZLtKQ5xNs39Yb1jP7RqpgwQFfM86ByQ65zVBKYIRXmDdVfJoG6GM+TeXz6gi3AHwkRmvzSuS5KQ/61GZ8gr6sD55aR1x/YNBsubR7VmKFOmRGAt8XcUND+ArHiDe4mBolKF8d+jYI7a5csDT6ewD5RyT5HOgi0mKobCntvnLQJ4OnCzLjZfihfaw/Dwdp1Ifr6wdvZDB6JtBCxHncOxQ+0oHWEHhzIWHgN1mSmx5CI08J6Hty1nNNF2rgUUdLjh9sYE51QcGWdtCQY5WdYJ2ttGWNhaNFeJR9LPtE+MN3vUtMh0aroCR4g9hs4aLxpcSbdkTlctkMoGuGV2yuFx4R+8CFkReuZNo2t87MophSXo09eEwFE92Nq1S0DrPOzN+IFAy/XhZKnKWHfA7Oi065HlOZ+N7vOQIEVfxrni1mKLarzqDfPGgR/rbwEq7i1YJqBChZU8WXb6ncnkI/bSpurStgz+2+PdSCFNFSmw/s4CPPeiqNPcXM5Z00GlOXkHJ8PkUnc9AhdKb0tfmeU6jC4CX3r9ScFMwTWFU7MfxcFRZ5z+aeaMM5ejqgkueu10=
@@ -6,6 +6,20 @@ For more information about changelogs, check
6
6
  [Keep a Changelog](http://keepachangelog.com) and
7
7
  [Vandamme](http://tech-angels.github.io/vandamme).
8
8
 
9
+ ## 0.2.0 - 2016/06/07
10
+
11
+ **How to upgrade**
12
+
13
+ If your code never calls `Funky::Video#view_count`, then you are good to go.
14
+
15
+ If it does, then be aware that Facebook has started displaying two types of
16
+ view counts in the video page: 'views from this post' and 'cumulative views'.
17
+ For coherence with the videos without this new type of page, `view_count` will
18
+ always return the "views from this post" (whereas it was returning cumulative
19
+ views in 0.1.1)
20
+
21
+ * [ENHANCEMENT] Always return 'views from this post' in `Funky::Video#view_count`.
22
+
9
23
  ## 0.1.1 - 2016/06/07
10
24
 
11
25
  * [BUGFIX] Added support for scraping view count from the new cumulative views that Facebook recently started rolling out.
@@ -18,7 +18,7 @@ module Funky
18
18
 
19
19
  def extract_views_from(html)
20
20
  html.match(/<div><\/div><span class="fcg">(.*) Views<\/span>/)
21
- html.match(/id="u_0_n">(.*?) Views/) if $1.nil?
21
+ html.match %r{([\d,]*?) views from this post} if $1.nil?
22
22
  matched_count $1
23
23
  end
24
24
 
@@ -1,3 +1,3 @@
1
1
  module Funky
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -113,7 +113,7 @@ module Funky
113
113
  [body]
114
114
  end
115
115
  else
116
- raise ContentNotFound, 'Please check IDs'
116
+ raise ContentNotFound, "Error #{response.code}: #{response.body}"
117
117
  end
118
118
  end
119
119
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2016-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  version: '0'
146
146
  requirements: []
147
147
  rubyforge_project:
148
- rubygems_version: 2.5.1
148
+ rubygems_version: 2.6.4
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: Funky is a Ruby library to fetch video data.