funky 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -9
- data/lib/funky/html/parser.rb +1 -1
- data/lib/funky/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac6d82bbd6aca0ce10bcb1301f5820b992c57e8e
|
4
|
+
data.tar.gz: d923336dd78754cc7c16f6678d0fe290750872e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6c9a8ab919d7eef5811afe3cf9f7f044eb6cabecf27939ed953baffdaee2f38735558a2237c85326b17461aa7451658c138da3db180ab4f94772c3f04494755
|
7
|
+
data.tar.gz: e04f978553c99cd673254ade664b9f3087bab38b7c2bafaecfaf3cdb881f75be1148912c5df21c121fa9fb1a82db121125f412128b32ca0e35f54a3fc13f8e0f
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ 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.4 - 2016/06/28
|
10
|
+
|
11
|
+
* [ENHANCEMENT] Change the way views are scraped from a Facebook page, by not depending the regex on the word "Views". This has the added benefit of being able to scrape the Facebook pages that are not just in English, but also in Hebrew. Potentially, it could scrape from other languages too, but that is speculation for now.
|
12
|
+
|
9
13
|
## 0.2.3 - 2016/06/22
|
10
14
|
|
11
15
|
* [FEATURE] Add `page_name` of a video found by API call (which is `Funky::Video.where`)
|
data/README.md
CHANGED
@@ -46,14 +46,6 @@ There are two ways to configure Funky with your App ID and App Secret:
|
|
46
46
|
config.app_secret = 'YourAppSecret'
|
47
47
|
end
|
48
48
|
```
|
49
|
-
Or with environment variables (which is safer) like so:
|
50
|
-
|
51
|
-
```ruby
|
52
|
-
Funky.configure do |config|
|
53
|
-
config.app_id = ENV['FB_APP_ID']
|
54
|
-
config.app_secret = ENV['FB_APP_SECRET']
|
55
|
-
end
|
56
|
-
```
|
57
49
|
|
58
50
|
### Use #where clause to get an array of videos
|
59
51
|
|
@@ -107,7 +99,7 @@ video.share_count # => 348
|
|
107
99
|
video.view_count # => 10121
|
108
100
|
```
|
109
101
|
|
110
|
-
If a non-existing video url is passed into #
|
102
|
+
If a non-existing video url is passed into #find_by_url!, Funky::ContentNotFound will be raised.
|
111
103
|
|
112
104
|
```ruby
|
113
105
|
Funky::Video.find_by_url!('https://www.facebook.com/video.php?v=doesnotexist')
|
data/lib/funky/html/parser.rb
CHANGED
@@ -17,7 +17,7 @@ module Funky
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def extract_views_from(html)
|
20
|
-
html.match(/<div><\/div><span class="fcg"
|
20
|
+
html.match(/<div><\/div><span class="fcg">\D*([,0-9]+)/)
|
21
21
|
html.match %r{([\d,]*?) views from this post} if $1.nil?
|
22
22
|
matched_count $1
|
23
23
|
end
|
data/lib/funky/version.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.4
|
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-
|
11
|
+
date: 2016-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|