film_snob 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/film_snob/funny_or_die.rb +17 -0
- data/lib/film_snob/url_to_video.rb +3 -1
- data/lib/film_snob/version.rb +1 -1
- data/spec/cassettes/space_jam.yml +58 -0
- data/spec/film_snob_spec.rb +13 -1
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NzM3N2U3OGM5ODA2NDYzYjVlMGFlNDc4ODU5ZmIwYTQwYzI0Nzk5ZA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 68f2d252de5dfd58ea1859447128a11e09487f38
|
4
|
+
data.tar.gz: fb87090737ec71405a7f7614a7722d2a89fdc576
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
ZGFiYzY3ZDdiN2Y4ZWNkOGZjN2JkYzQ3YzkyZWZmOWRiMDJlMjBhNDVjNzZk
|
11
|
-
OTVjODQ0NzU5ZGUxNDA2Nzc3NjQ5Yzg2NmYxYzE3NzNhMWRjOTI=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NGYwNTY5NWJlNTgwN2JmYjlmMWYwMTE4MDMwYzZmZjJlN2QzNTA4MzU1MTg3
|
14
|
-
ZDU2ZmYyODY2Nzc5YTJhOWUzODk4N2E3MDhmMThiZmE3Y2FjYzZiYmM2ZDRj
|
15
|
-
MzVhYjAwYTQ5MDc3ZjcyYzU3N2EzNTAyNzUxN2I3MWVjMGQxMjk=
|
6
|
+
metadata.gz: 797a67529ca690f0916412f4a1a00a681d6d4e99483ff7e3e704c92fff15a3976456d97007859e7b135386a294282fc8c41d9fa0c0a93061b2c10fb45cfce53a
|
7
|
+
data.tar.gz: c9b8170d9733cfea6e4ccf009876c43ecac5f17580b7a0da3b42b765cf83a540fd5ed8e7b1147253d14f4e0f616682ea33a0f3f6884ccc6408b9f82fc2b8fbff
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class FilmSnob
|
2
|
+
class FunnyOrDie < VideoSite
|
3
|
+
def self.valid_url_patterns
|
4
|
+
[
|
5
|
+
%r{http://www.funnyordie.com/videos/([\w\d]+)}
|
6
|
+
]
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.oembed_endpoint
|
10
|
+
"http://www.funnyordie.com/oembed.json"
|
11
|
+
end
|
12
|
+
|
13
|
+
def clean_url
|
14
|
+
@clean_url ||= "http://www.funnyordie.com/videos/#{id}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require "film_snob/vimeo"
|
2
2
|
require "film_snob/youtube"
|
3
3
|
require "film_snob/hulu"
|
4
|
+
require "film_snob/funny_or_die"
|
4
5
|
|
5
6
|
class FilmSnob
|
6
7
|
class UrlToVideo
|
@@ -8,7 +9,8 @@ class FilmSnob
|
|
8
9
|
VIDEO_SITES = [
|
9
10
|
Vimeo,
|
10
11
|
YouTube,
|
11
|
-
Hulu
|
12
|
+
Hulu,
|
13
|
+
FunnyOrDie
|
12
14
|
]
|
13
15
|
|
14
16
|
attr_reader :url, :options
|
data/lib/film_snob/version.rb
CHANGED
@@ -0,0 +1,58 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.funnyordie.com/oembed.json?url=http://www.funnyordie.com/videos/8db066d2e0
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
Server:
|
16
|
+
- nginx
|
17
|
+
Content-Type:
|
18
|
+
- application/json; charset=utf-8
|
19
|
+
Status:
|
20
|
+
- 200 OK
|
21
|
+
X-Frame-Options:
|
22
|
+
- ALLOWALL
|
23
|
+
X-Xss-Protection:
|
24
|
+
- 1; mode=block; report=/report_xss;
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
X-Ua-Compatible:
|
28
|
+
- chrome=1
|
29
|
+
Etag:
|
30
|
+
- '"bf2b27d19328373c12ec3f1c5a813b56"'
|
31
|
+
X-Request-Id:
|
32
|
+
- 981b6969-3e49-462a-b4a8-37fd14702479
|
33
|
+
X-Runtime:
|
34
|
+
- '0.025448'
|
35
|
+
X-Varnish:
|
36
|
+
- '1732560026'
|
37
|
+
- '318926149'
|
38
|
+
Served-By:
|
39
|
+
- prodweb2/prodweb1/278007-prodapp3
|
40
|
+
Expires:
|
41
|
+
- Sat, 19 Apr 2014 03:15:41 GMT
|
42
|
+
Cache-Control:
|
43
|
+
- max-age=0, no-cache, no-store
|
44
|
+
Pragma:
|
45
|
+
- no-cache
|
46
|
+
Date:
|
47
|
+
- Sat, 19 Apr 2014 03:15:41 GMT
|
48
|
+
Content-Length:
|
49
|
+
- '1751'
|
50
|
+
Connection:
|
51
|
+
- keep-alive
|
52
|
+
body:
|
53
|
+
encoding: UTF-8
|
54
|
+
string: |
|
55
|
+
{"type":"video","version":"1.0","provider_name":"Funny or Die","provider_url":"http://www.funnyordie.com","author_name":"Seth Green","author_url":"http://www.funnyordie.com/seth_green","title":"The Live Read of Space Jam with Blake Griffin","html":"\u003Ciframe src=\"http://www.funnyordie.com/embed/8db066d2e0\" width=\"960\" height=\"580\" frameborder=\"0\" allowfullscreen webkitallowfullscreen mozallowfullscreen\u003E\u003C/iframe\u003E\u003Cdiv style=\"text-align:left;font-size:x-small;margin-top:0;width:960px;\"\u003E\u003Ca href=\"http://www.funnyordie.com/videos/8db066d2e0/the-live-read-of-space-jam-with-blake-griffin\" title=\"from Seth Green, Blake Griffin, DeAndre Jordan, Danielle Fishel, Paul Scheer, Nick Kroll, Ben Schwartz, Jerrod Carmichael, Noah Garfinkel, Brandon Johnson, Melissa Stetten, Shelby Fero, Jensen Karp, Ally Hord, Funny Or Die, Matt Sweeney, BoTown Sound, and Nate Maggio\"\u003EThe Live Read of Space Jam with Blake Griffin\u003C/a\u003E from \u003Ca href=\"http://www.funnyordie.com/seth_green\"\u003ESeth Green\u003C/a\u003E \u003Ciframe src=\"http://www.facebook.com/plugins/like.php?app_id=138711277798\u0026amp;href=http%3A%2F%2Fwww.funnyordie.com%2Fvideos%2F8db066d2e0%2Fthe-live-read-of-space-jam-with-blake-griffin\u0026amp;send=false\u0026amp;layout=button_count\u0026amp;width=150\u0026amp;show_faces=false\u0026amp;action=like\u0026amp;height=21\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:90px; height:21px; vertical-align:middle;\" allowTransparency=\"true\"\u003E\u003C/iframe\u003E\n\u003C/div\u003E","width":960,"height":580,"thumbnail_width":464,"thumbnail_height":348,"thumbnail_url":"http://t.fod4.com/t/8db066d2e0/c480x270_58.jpg","duration":584.817}
|
56
|
+
http_version:
|
57
|
+
recorded_at: Sat, 19 Apr 2014 03:15:41 GMT
|
58
|
+
recorded_with: VCR 2.9.0
|
data/spec/film_snob_spec.rb
CHANGED
@@ -94,7 +94,7 @@ describe FilmSnob do
|
|
94
94
|
expect(snob2.site).to eq :vimeo
|
95
95
|
expect(snob2.clean_url).to eq 'https://vimeo.com/51020067'
|
96
96
|
end
|
97
|
-
|
97
|
+
|
98
98
|
it 'should allow oembed configuration' do
|
99
99
|
snob = FilmSnob.new("http://vimeo.com/31158841", width: 400)
|
100
100
|
VCR.use_cassette "murmuration" do
|
@@ -120,4 +120,16 @@ describe FilmSnob do
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
+
describe 'funny or die URLs' do
|
124
|
+
it 'should parse funny or die URLs' do
|
125
|
+
film = FilmSnob.new("http://www.funnyordie.com/videos/8db066d2e0/the-live-read-of-space-jam-with-blake-griffin")
|
126
|
+
expect(film.id).to eq '8db066d2e0'
|
127
|
+
expect(film.site).to eq :funnyordie
|
128
|
+
VCR.use_cassette 'space jam' do
|
129
|
+
expect(film.title).to eq 'The Live Read of Space Jam with Blake Griffin'
|
130
|
+
expect{film.html}.not_to raise_error
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
123
135
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: film_snob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Jacobson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -84,14 +84,14 @@ dependencies:
|
|
84
84
|
name: debugger
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- film_snob.gemspec
|
125
125
|
- lib/film_snob.rb
|
126
126
|
- lib/film_snob/exceptions.rb
|
127
|
+
- lib/film_snob/funny_or_die.rb
|
127
128
|
- lib/film_snob/hulu.rb
|
128
129
|
- lib/film_snob/url_to_video.rb
|
129
130
|
- lib/film_snob/version.rb
|
@@ -136,6 +137,7 @@ files:
|
|
136
137
|
- spec/cassettes/harmon.yml
|
137
138
|
- spec/cassettes/murmuration.yml
|
138
139
|
- spec/cassettes/murmuration2.yml
|
140
|
+
- spec/cassettes/space_jam.yml
|
139
141
|
- spec/cassettes/stephen.yml
|
140
142
|
- spec/film_snob_spec.rb
|
141
143
|
- spec/spec_helper.rb
|
@@ -150,12 +152,12 @@ require_paths:
|
|
150
152
|
- lib
|
151
153
|
required_ruby_version: !ruby/object:Gem::Requirement
|
152
154
|
requirements:
|
153
|
-
- -
|
155
|
+
- - '>='
|
154
156
|
- !ruby/object:Gem::Version
|
155
157
|
version: '0'
|
156
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
159
|
requirements:
|
158
|
-
- -
|
160
|
+
- - '>='
|
159
161
|
- !ruby/object:Gem::Version
|
160
162
|
version: '0'
|
161
163
|
requirements: []
|
@@ -171,6 +173,7 @@ test_files:
|
|
171
173
|
- spec/cassettes/harmon.yml
|
172
174
|
- spec/cassettes/murmuration.yml
|
173
175
|
- spec/cassettes/murmuration2.yml
|
176
|
+
- spec/cassettes/space_jam.yml
|
174
177
|
- spec/cassettes/stephen.yml
|
175
178
|
- spec/film_snob_spec.rb
|
176
179
|
- spec/spec_helper.rb
|