film_snob 0.3.9 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c8385e0d2006bf30b009d9297fbff0c429f2fd46
4
+ data.tar.gz: a0243c73be7b8e2e133f2358db8fb3d5661ed80b
5
+ SHA512:
6
+ metadata.gz: 5b8d767dbbb7d94b6f800add86f4c1e31da4555cc0122c275cf3671d2596c7e3a273802582e56cc0e31cc871f4d90bf929df256511c723f9339e5411cafb42dd
7
+ data.tar.gz: fe697c709cd4bc496e13368650c88931c063fb9fcdd7b327e6decafe4cdc9d323f0b0ddb30c86f79170ffb8211a987bafa1bf2c49e17bef6513e0f00edc551ae
data/README.md CHANGED
@@ -47,6 +47,7 @@ film_snob uses the oembed protocol to get html for embed codes. These options as
47
47
  * Hulu
48
48
  * Funny or Die
49
49
  * Coub
50
+ * Instagram
50
51
 
51
52
  The same methods work with all of these providers.
52
53
 
@@ -0,0 +1,22 @@
1
+ require "film_snob/video_site"
2
+
3
+ class FilmSnob
4
+ class Dailymotion < VideoSite
5
+
6
+ def self.valid_url_patterns
7
+ [
8
+ %r{https?://www.dailymotion.com/video/([\w\d\-_]+)},
9
+ %r{https?://touch.dailymotion.com/video/([\w\d\-_]+)},
10
+ ]
11
+ end
12
+
13
+ def clean_url
14
+ @clean_url ||= "https://www.dailymotion.com/video/#{id}"
15
+ end
16
+
17
+ def self.oembed_endpoint
18
+ 'http://www.dailymotion.com/services/oembed'
19
+ end
20
+
21
+ end
22
+ end
@@ -0,0 +1,28 @@
1
+ require "film_snob/video_site"
2
+
3
+ class FilmSnob
4
+ class Instagram < VideoSite
5
+ def self.valid_url_patterns
6
+ [
7
+ %r{https?://(?:(?:www).)?instagram.com/p/(\w+)},
8
+ %r{https?://(?:(?:www).)?instagr.am/p/(\w+)}
9
+ ]
10
+ end
11
+
12
+ def self.oembed_endpoint
13
+ 'http://api.instagram.com/oembed'
14
+ end
15
+
16
+ def clean_url
17
+ @clean_url ||= "http://instagram.com/p/#{id}"
18
+ end
19
+
20
+ def html
21
+ # instagram's oembed response does not include html, so we need to construct it
22
+ # but first we need to ensure that the response was good
23
+ # which we do by checking for the presence of the title,
24
+ # which will raise an exception if it's not present
25
+ title && %{<iframe src="//instagram.com/p/#{id}/embed/" width="612" height="710" frameborder="0" scrolling="no" allowtransparency="true"></iframe>}
26
+ end
27
+ end
28
+ end
@@ -1,8 +1,10 @@
1
1
  require "film_snob/coub"
2
2
  require "film_snob/funny_or_die"
3
3
  require "film_snob/hulu"
4
+ require "film_snob/instagram"
4
5
  require "film_snob/vimeo"
5
6
  require "film_snob/youtube"
7
+ require "film_snob/dailymotion"
6
8
 
7
9
  class FilmSnob
8
10
  class UrlToVideo
@@ -12,7 +14,9 @@ class FilmSnob
12
14
  YouTube,
13
15
  Hulu,
14
16
  FunnyOrDie,
15
- Coub
17
+ Coub,
18
+ Dailymotion,
19
+ Instagram
16
20
  ]
17
21
 
18
22
  attr_reader :url, :options
@@ -1,3 +1,3 @@
1
1
  class FilmSnob
2
- VERSION = "0.3.9"
2
+ VERSION = "0.3.10"
3
3
  end
@@ -10,20 +10,18 @@ http_interactions:
10
10
  Accept-Encoding:
11
11
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
12
  Accept:
13
- - "*/*"
13
+ - '*/*'
14
14
  User-Agent:
15
15
  - Ruby
16
- Host:
17
- - coub.com
18
16
  response:
19
17
  status:
20
18
  code: 200
21
19
  message: OK
22
20
  headers:
23
21
  Server:
24
- - nginx/1.4.4
22
+ - nginx/1.6.0
25
23
  Date:
26
- - Fri, 06 Jun 2014 02:59:56 GMT
24
+ - Sat, 14 Jun 2014 17:58:08 GMT
27
25
  Content-Type:
28
26
  - application/json; charset=utf-8
29
27
  Transfer-Encoding:
@@ -39,9 +37,9 @@ http_interactions:
39
37
  Cache-Control:
40
38
  - max-age=0, private, must-revalidate
41
39
  X-Request-Id:
42
- - 271c6fd4f094ad88c161efa47990e5e1
40
+ - 81f87a96c58b8c31b7c28ee4f0c7ad81
43
41
  X-Runtime:
44
- - '0.011259'
42
+ - '0.009698'
45
43
  X-Rack-Cache:
46
44
  - miss
47
45
  body:
@@ -51,5 +49,5 @@ http_interactions:
51
49
  src=\"http://coub.com/embed/rcd14cm\" allowfullscreen=\"true\" frameborder=\"0\"
52
50
  width=\"640\" height=\"489\"></iframe>"}'
53
51
  http_version:
54
- recorded_at: Fri, 06 Jun 2014 02:59:56 GMT
52
+ recorded_at: Sat, 14 Jun 2014 17:58:08 GMT
55
53
  recorded_with: VCR 2.9.2
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www.dailymotion.com/services/oembed?url=https://www.dailymotion.com/video/xf02xp_uffie-difficult_music
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - DMS/1.0.42
23
+ X-Dm-Backnode:
24
+ - web-055.adm.dailymotion.com:80
25
+ Vary:
26
+ - Accept-Encoding
27
+ Cache-Control:
28
+ - no-cache
29
+ Content-Type:
30
+ - application/json
31
+ P3p:
32
+ - policyref="http://www.dailymotion.com/w3c/p3p.xml", CP="IDC DSP CURa ADMa
33
+ DEVa TAIa OUR BUS IND UNI COM NAV INT"
34
+ Date:
35
+ - Tue, 10 Jun 2014 19:33:06 GMT
36
+ X-Dm-Lb:
37
+ - 195.8.215.136
38
+ X-Response-Time:
39
+ - 0.046583 seconds
40
+ Set-Cookie:
41
+ - dt=desktop; expires=Wed, 10-Jun-2015 19:33:06 GMT; Max-Age=31536000; path=/;
42
+ domain=.dailymotion.com
43
+ - ts=804012; expires=Mon, 10-Jun-2024 19:33:06 GMT; Max-Age=315619200; path=/;
44
+ domain=.dailymotion.com
45
+ X-Dm-Page:
46
+ - in.html.oembed
47
+ Content-Length:
48
+ - '272'
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"type":"video","version":"1.0","provider_name":"Dailymotion","provider_url":"http:\/\/www.dailymotion.com","title":"Uffie
52
+ - Difficult","author_name":"Uffie","author_url":"http:\/\/www.dailymotion.com\/Uffie","width":480,"height":276,"html":"<iframe
53
+ src=\"http:\/\/www.dailymotion.com\/embed\/video\/xf02xp\" width=\"480\" height=\"276\"
54
+ frameborder=\"0\"><\/iframe>","thumbnail_url":"http:\/\/s1.dmcdn.net\/YITp\/x240-GT0.jpg","thumbnail_width":320,"thumbnail_height":240}'
55
+ http_version:
56
+ recorded_at: Tue, 10 Jun 2014 19:33:06 GMT
57
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www.dailymotion.com/services/oembed?maxwidth=400&url=https://www.dailymotion.com/video/xf02xp_uffie-difficult_music
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - DMS/1.0.42
23
+ X-Dm-Backnode:
24
+ - web-034.adm.dailymotion.com:80
25
+ Vary:
26
+ - Accept-Encoding
27
+ Cache-Control:
28
+ - no-cache
29
+ Content-Type:
30
+ - application/json
31
+ P3p:
32
+ - policyref="http://www.dailymotion.com/w3c/p3p.xml", CP="IDC DSP CURa ADMa
33
+ DEVa TAIa OUR BUS IND UNI COM NAV INT"
34
+ Date:
35
+ - Tue, 10 Jun 2014 19:33:06 GMT
36
+ X-Dm-Lb:
37
+ - 195.8.215.136
38
+ X-Response-Time:
39
+ - 0.030717 seconds
40
+ Set-Cookie:
41
+ - dt=desktop; expires=Wed, 10-Jun-2015 19:33:06 GMT; Max-Age=31536000; path=/;
42
+ domain=.dailymotion.com
43
+ - ts=637945; expires=Mon, 10-Jun-2024 19:33:06 GMT; Max-Age=315619200; path=/;
44
+ domain=.dailymotion.com
45
+ X-Dm-Page:
46
+ - in.html.oembed
47
+ Content-Length:
48
+ - '269'
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"type":"video","version":"1.0","provider_name":"Dailymotion","provider_url":"http:\/\/www.dailymotion.com","title":"Uffie
52
+ - Difficult","author_name":"Uffie","author_url":"http:\/\/www.dailymotion.com\/Uffie","width":"400","height":230,"html":"<iframe
53
+ src=\"http:\/\/www.dailymotion.com\/embed\/video\/xf02xp\" width=\"400\" height=\"230\"
54
+ frameborder=\"0\"><\/iframe>","thumbnail_url":"http:\/\/s1.dmcdn.net\/YITp\/x120-jMg.jpg","thumbnail_width":160,"thumbnail_height":120}'
55
+ http_version:
56
+ recorded_at: Tue, 10 Jun 2014 19:33:06 GMT
57
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www.dailymotion.com/services/oembed?maxwidth=500&url=https://www.dailymotion.com/video/xf02xp_uffie-difficult_music
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - DMS/1.0.42
23
+ X-Dm-Backnode:
24
+ - web-107.adm.dailymotion.com:80
25
+ Vary:
26
+ - Accept-Encoding
27
+ Cache-Control:
28
+ - no-cache
29
+ Content-Type:
30
+ - application/json
31
+ P3p:
32
+ - policyref="http://www.dailymotion.com/w3c/p3p.xml", CP="IDC DSP CURa ADMa
33
+ DEVa TAIa OUR BUS IND UNI COM NAV INT"
34
+ Date:
35
+ - Tue, 10 Jun 2014 19:33:06 GMT
36
+ X-Dm-Lb:
37
+ - 195.8.215.136
38
+ X-Response-Time:
39
+ - 0.029759 seconds
40
+ Set-Cookie:
41
+ - dt=desktop; expires=Wed, 10-Jun-2015 19:33:06 GMT; Max-Age=31536000; path=/;
42
+ domain=.dailymotion.com
43
+ - ts=33936; expires=Mon, 10-Jun-2024 19:33:06 GMT; Max-Age=315619200; path=/;
44
+ domain=.dailymotion.com
45
+ X-Dm-Page:
46
+ - in.html.oembed
47
+ Content-Length:
48
+ - '271'
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"type":"video","version":"1.0","provider_name":"Dailymotion","provider_url":"http:\/\/www.dailymotion.com","title":"Uffie
52
+ - Difficult","author_name":"Uffie","author_url":"http:\/\/www.dailymotion.com\/Uffie","width":"500","height":287,"html":"<iframe
53
+ src=\"http:\/\/www.dailymotion.com\/embed\/video\/xf02xp\" width=\"500\" height=\"287\"
54
+ frameborder=\"0\"><\/iframe>","thumbnail_url":"http:\/\/s1.dmcdn.net\/YITp\/x240-GT0.jpg","thumbnail_width":320,"thumbnail_height":240}'
55
+ http_version:
56
+ recorded_at: Tue, 10 Jun 2014 19:33:07 GMT
57
+ recorded_with: VCR 2.9.2
@@ -13,8 +13,6 @@ http_interactions:
13
13
  - "*/*"
14
14
  User-Agent:
15
15
  - Ruby
16
- Host:
17
- - www.funnyordie.com
18
16
  response:
19
17
  status:
20
18
  code: 200
@@ -37,24 +35,24 @@ http_interactions:
37
35
  Etag:
38
36
  - '"bf2b27d19328373c12ec3f1c5a813b56"'
39
37
  X-Request-Id:
40
- - 39767a34-cf4a-43e7-995a-ed12770d1dba
38
+ - c5f1ccbf-57bc-4664-83f0-b347479adc4c
41
39
  X-Runtime:
42
- - '0.021698'
40
+ - '0.021709'
43
41
  X-Varnish:
44
- - '472126988'
45
- - '472126989'
42
+ - '491365600'
43
+ - '602866980'
46
44
  Served-By:
47
- - prodweb1/prodweb1/278006-prodapp2
45
+ - prodweb2/prodweb1/278007-prodapp3
48
46
  Vary:
49
47
  - Accept-Encoding
50
48
  Expires:
51
- - Fri, 06 Jun 2014 02:59:56 GMT
49
+ - Tue, 10 Jun 2014 19:33:08 GMT
52
50
  Cache-Control:
53
51
  - max-age=0, no-cache, no-store
54
52
  Pragma:
55
53
  - no-cache
56
54
  Date:
57
- - Fri, 06 Jun 2014 02:59:56 GMT
55
+ - Tue, 10 Jun 2014 19:33:08 GMT
58
56
  Content-Length:
59
57
  - '1751'
60
58
  Connection:
@@ -64,5 +62,5 @@ http_interactions:
64
62
  string: |
65
63
  {"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}
66
64
  http_version:
67
- recorded_at: Fri, 06 Jun 2014 02:59:56 GMT
65
+ recorded_at: Tue, 10 Jun 2014 19:33:08 GMT
68
66
  recorded_with: VCR 2.9.2
@@ -13,8 +13,6 @@ http_interactions:
13
13
  - "*/*"
14
14
  User-Agent:
15
15
  - Ruby
16
- Host:
17
- - www.hulu.com
18
16
  response:
19
17
  status:
20
18
  code: 200
@@ -31,19 +29,19 @@ http_interactions:
31
29
  X-Ua-Compatible:
32
30
  - IE=EmulateIE9; IE=EmulateIE7
33
31
  Cache-Control:
34
- - max-age=1205
32
+ - max-age=2732
35
33
  Date:
36
- - Fri, 06 Jun 2014 02:59:56 GMT
34
+ - Tue, 10 Jun 2014 19:33:07 GMT
37
35
  Connection:
38
36
  - keep-alive
39
37
  body:
40
38
  encoding: UTF-8
41
- string: '{"thumbnail_height":80,"thumbnail_url":"http://ib.huluim.com/video/50172061?size=145x80&caller=h1o&img=i","type":"video","cache_age":3600,"title":"Remedial
42
- Chaos Theory (Community)","width":512,"large_thumbnail_url":"http://ib.huluim.com/video/50172061?size=512x288&caller=h1o&img=i","large_thumbnail_width":512,"height":296,"embed_url":"http://www.hulu.com/embed.html?eid=CbtnRM8PBJsCfZpUy2V3Yg","html":"<iframe
39
+ string: '{"thumbnail_height":80,"type":"video","cache_age":3600,"title":"Remedial
40
+ Chaos Theory (Community)","width":512,"large_thumbnail_url":"http://ib.huluim.com/video/50172061?size=512x288&caller=h1o&img=i","thumbnail_url":"http://ib.huluim.com/video/50172061?size=145x80&caller=h1o&img=i","duration":1286.87,"large_thumbnail_width":512,"height":296,"embed_url":"http://www.hulu.com/embed.html?eid=CbtnRM8PBJsCfZpUy2V3Yg","html":"<iframe
43
41
  width=\"512\" height=\"296\" src=\"http://www.hulu.com/embed.html?eid=CbtnRM8PBJsCfZpUy2V3Yg\"
44
42
  frameborder=\"0\" scrolling=\"no\" webkitAllowFullScreen mozallowfullscreen
45
43
  allowfullscreen> </iframe>","version":"1.0","air_date":"Thu Oct 13 00:00:00
46
- UTC 2011","large_thumbnail_height":288,"author_name":"NBC","provider_name":"Hulu","duration":1286.87,"thumbnail_width":145,"provider_url":"http://www.hulu.com/"}'
44
+ UTC 2011","large_thumbnail_height":288,"author_name":"NBC","provider_name":"Hulu","thumbnail_width":145,"provider_url":"http://www.hulu.com/"}'
47
45
  http_version:
48
- recorded_at: Fri, 06 Jun 2014 02:59:56 GMT
46
+ recorded_at: Tue, 10 Jun 2014 19:33:08 GMT
49
47
  recorded_with: VCR 2.9.2
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.instagram.com/oembed?url=http://instagram.com/p/nothinghere
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 404
19
+ message: NOT FOUND
20
+ headers:
21
+ Cache-Control:
22
+ - private, no-cache, no-store, must-revalidate
23
+ Content-Language:
24
+ - en
25
+ Content-Type:
26
+ - text/html; charset=utf-8
27
+ Date:
28
+ - Sat, 14 Jun 2014 18:32:21 GMT
29
+ Expires:
30
+ - Sat, 01 Jan 2000 00:00:00 GMT
31
+ Pragma:
32
+ - no-cache
33
+ Server:
34
+ - nginx
35
+ Set-Cookie:
36
+ - ccode=US; Path=/
37
+ - csrftoken=a0b5eadbb95eef7aeb5827d2f9d4463a; expires=Sat, 13-Jun-2015 18:32:21
38
+ GMT; Max-Age=31449600; Path=/
39
+ - mid=U5yVNQAEAAESFFbkTkaqHKJGfs3C; expires=Fri, 09-Jun-2034 18:32:21 GMT; Max-Age=630720000;
40
+ Path=/
41
+ Vary:
42
+ - Cookie, Accept-Language
43
+ Transfer-Encoding:
44
+ - chunked
45
+ Connection:
46
+ - keep-alive
47
+ body:
48
+ encoding: UTF-8
49
+ string: No Media Match
50
+ http_version:
51
+ recorded_at: Sat, 14 Jun 2014 18:32:21 GMT
52
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.instagram.com/oembed?url=http://instagram.com/p/oBkLq7hnDP
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - nginx
23
+ Date:
24
+ - Sat, 14 Jun 2014 18:30:49 GMT
25
+ Content-Type:
26
+ - application/json
27
+ Content-Language:
28
+ - en
29
+ Expires:
30
+ - Sat, 01 Jan 2000 00:00:00 GMT
31
+ Vary:
32
+ - Cookie, Accept-Language, Accept-Encoding
33
+ Pragma:
34
+ - no-cache
35
+ Cache-Control:
36
+ - private, no-cache, no-store, must-revalidate
37
+ Set-Cookie:
38
+ - ccode=US; Path=/
39
+ - csrftoken=55a027991158ce65b2afd38bad80e282; expires=Sat, 13-Jun-2015 18:30:49
40
+ GMT; Max-Age=31449600; Path=/
41
+ - mid=U5yU2QAEAAEx5oeFJ6iHcEfJ9sl5; expires=Fri, 09-Jun-2034 18:30:49 GMT; Max-Age=630720000;
42
+ Path=/
43
+ Connection:
44
+ - keep-alive
45
+ Content-Length:
46
+ - '276'
47
+ body:
48
+ encoding: UTF-8
49
+ string: '{"provider_url":"http:\/\/instagram.com\/","media_id":"721016547040456911_195995411","title":"Very
50
+ stupid package! \ud83d\ude40","url":"http:\/\/videos-h-17.ak.instagram.com\/hphotos-ak-xap1\/10357107_1419962164942557_1070438508_n.mp4","author_name":"bonch_bruevich","height":640,"width":640,"version":"1.0","author_url":"http:\/\/instagram.com\/bonch_bruevich","author_id":195995411,"type":"photo","provider_name":"Instagram"}'
51
+ http_version:
52
+ recorded_at: Sat, 14 Jun 2014 18:30:49 GMT
53
+ recorded_with: VCR 2.9.2
@@ -13,45 +13,42 @@ http_interactions:
13
13
  - "*/*"
14
14
  User-Agent:
15
15
  - Ruby
16
- Host:
17
- - vimeo.com
18
16
  response:
19
17
  status:
20
18
  code: 200
21
19
  message: OK
22
20
  headers:
23
- Age:
24
- - '1'
25
- Date:
26
- - Fri, 06 Jun 2014 02:59:55 GMT
27
- Expires:
28
- - Fri, 06 Jun 2014 03:00:55 GMT
29
- Content-Length:
30
- - '793'
31
- Connection:
32
- - Keep-Alive
33
- Via:
34
- - 1.1 varnish
35
- - dnet-dca
36
- Etag:
37
- - '"5ffeebb02a34c4b0edaf908978ae3dc7a08a8994"'
38
21
  Server:
39
22
  - Apache
40
23
  Access-Control-Allow-Origin:
41
24
  - "*"
42
25
  Access-Control-Allow-Headers:
43
26
  - X-Requested-With
27
+ Expires:
28
+ - Tue, 10 Jun 2014 19:34:05 GMT
44
29
  Last-Modified:
45
- - Fri, 06 Jun 2014 02:09:21 GMT
30
+ - Tue, 10 Jun 2014 19:11:46 GMT
31
+ Etag:
32
+ - '"d8d616aef320a327e49d95e0cefe36c1e8a16060"'
46
33
  Vary:
47
34
  - Accept-Encoding
48
35
  Content-Type:
49
36
  - application/json
37
+ Content-Length:
38
+ - '439'
39
+ Accept-Ranges:
40
+ - bytes
41
+ Date:
42
+ - Tue, 10 Jun 2014 19:33:05 GMT
50
43
  X-Varnish:
51
- - '1670035520'
44
+ - '1847121041'
45
+ Age:
46
+ - '0'
47
+ Via:
48
+ - 1.1 varnish
52
49
  X-Varnish-Cache:
53
50
  - '0'
54
- Nncoection:
51
+ Connection:
55
52
  - close
56
53
  X-Vserver:
57
54
  - dfvimeowebproxy3
@@ -65,5 +62,5 @@ http_interactions:
65
62
  Islands And Rivers\n\nFollow us @Islands_Rivers\n\nA chance encounter and
66
63
  shared moment with one of natures greatest and most fleeting phenomena.","thumbnail_url":"http:\/\/i.vimeocdn.com\/video\/448600816_295x166.jpg","thumbnail_width":295,"thumbnail_height":221,"video_id":31158841}'
67
64
  http_version:
68
- recorded_at: Fri, 06 Jun 2014 02:59:55 GMT
65
+ recorded_at: Tue, 10 Jun 2014 19:33:05 GMT
69
66
  recorded_with: VCR 2.9.2
@@ -7,8 +7,10 @@ http_interactions:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
10
12
  Accept:
11
- - ! '*/*'
13
+ - "*/*"
12
14
  User-Agent:
13
15
  - Ruby
14
16
  response:
@@ -19,38 +21,40 @@ http_interactions:
19
21
  Server:
20
22
  - Apache
21
23
  Access-Control-Allow-Origin:
22
- - ! '*'
24
+ - "*"
23
25
  Access-Control-Allow-Headers:
24
26
  - X-Requested-With
25
27
  Expires:
26
- - Fri, 06 Jun 2014 03:05:51 GMT
28
+ - Tue, 10 Jun 2014 19:34:05 GMT
27
29
  Last-Modified:
28
- - Fri, 06 Jun 2014 02:09:21 GMT
30
+ - Tue, 10 Jun 2014 19:11:46 GMT
29
31
  Etag:
30
- - ! '"5ffeebb02a34c4b0edaf908978ae3dc7a08a8994"'
32
+ - '"d8d616aef320a327e49d95e0cefe36c1e8a16060"'
31
33
  Vary:
32
34
  - Accept-Encoding
33
35
  Content-Type:
34
36
  - application/json
35
- Transfer-Encoding:
36
- - chunked
37
+ Content-Length:
38
+ - '442'
39
+ Accept-Ranges:
40
+ - bytes
37
41
  Date:
38
- - Fri, 06 Jun 2014 03:04:51 GMT
42
+ - Tue, 10 Jun 2014 19:33:05 GMT
39
43
  X-Varnish:
40
- - '1671233141'
44
+ - '1426306345'
41
45
  Age:
42
46
  - '0'
43
47
  Via:
44
48
  - 1.1 varnish
45
49
  X-Varnish-Cache:
46
50
  - '0'
47
- Nncoection:
51
+ Connection:
48
52
  - close
49
53
  X-Vserver:
50
- - dfvimeowebproxy3
54
+ - dfvimeowebproxy5
51
55
  body:
52
- encoding: US-ASCII
53
- string: ! '{"type":"video","version":"1.0","provider_name":"Vimeo","provider_url":"https:\/\/vimeo.com\/","title":"Murmuration","author_name":"Islands
56
+ encoding: UTF-8
57
+ string: '{"type":"video","version":"1.0","provider_name":"Vimeo","provider_url":"https:\/\/vimeo.com\/","title":"Murmuration","author_name":"Islands
54
58
  & Rivers","author_url":"http:\/\/vimeo.com\/islandsandrivers","is_plus":"1","html":"<iframe
55
59
  src=\"\/\/player.vimeo.com\/video\/31158841\" width=\"500\" height=\"375\"
56
60
  frameborder=\"0\" title=\"Murmuration\" webkitallowfullscreen mozallowfullscreen
@@ -58,5 +62,5 @@ http_interactions:
58
62
  Islands And Rivers\n\nFollow us @Islands_Rivers\n\nA chance encounter and
59
63
  shared moment with one of natures greatest and most fleeting phenomena.","thumbnail_url":"http:\/\/i.vimeocdn.com\/video\/448600816_295x166.jpg","thumbnail_width":295,"thumbnail_height":221,"video_id":31158841}'
60
64
  http_version:
61
- recorded_at: Fri, 06 Jun 2014 03:04:51 GMT
65
+ recorded_at: Tue, 10 Jun 2014 19:33:06 GMT
62
66
  recorded_with: VCR 2.9.2
@@ -13,34 +13,23 @@ http_interactions:
13
13
  - "*/*"
14
14
  User-Agent:
15
15
  - Ruby
16
- Host:
17
- - vimeo.com
18
16
  response:
19
17
  status:
20
18
  code: 200
21
19
  message: OK
22
20
  headers:
23
- Age:
24
- - '1'
25
- Date:
26
- - Fri, 06 Jun 2014 02:59:55 GMT
27
- Expires:
28
- - Fri, 06 Jun 2014 03:00:55 GMT
29
- Connection:
30
- - Keep-Alive
31
- Via:
32
- - 1.1 varnish
33
- - dnet-dca
34
- Etag:
35
- - '"3ee9abac968dd90ff3d61a6c3ed1e6aac5a93a7d"'
36
21
  Server:
37
22
  - Apache
38
23
  Access-Control-Allow-Origin:
39
24
  - "*"
40
25
  Access-Control-Allow-Headers:
41
26
  - X-Requested-With
27
+ Expires:
28
+ - Tue, 10 Jun 2014 19:34:04 GMT
42
29
  Last-Modified:
43
30
  - Sun, 13 Apr 2014 19:06:59 GMT
31
+ Etag:
32
+ - '"3ee9abac968dd90ff3d61a6c3ed1e6aac5a93a7d"'
44
33
  Vary:
45
34
  - Accept-Encoding
46
35
  Content-Type:
@@ -49,14 +38,20 @@ http_interactions:
49
38
  - '478'
50
39
  Accept-Ranges:
51
40
  - bytes
41
+ Date:
42
+ - Tue, 10 Jun 2014 19:33:04 GMT
52
43
  X-Varnish:
53
- - '1817515816'
44
+ - '1580370168'
45
+ Age:
46
+ - '0'
47
+ Via:
48
+ - 1.1 varnish
54
49
  X-Varnish-Cache:
55
50
  - '0'
56
- Cneonction:
51
+ Connection:
57
52
  - close
58
53
  X-Vserver:
59
- - dfvimeowebproxy4
54
+ - dfvimeowebproxy1
60
55
  body:
61
56
  encoding: UTF-8
62
57
  string: '{"type":"video","version":"1.0","provider_name":"Vimeo","provider_url":"https:\/\/vimeo.com\/","title":"Days
@@ -68,5 +63,5 @@ http_interactions:
68
63
  the whole thing, but if you do, lemme know. \n\nTuesday, October 19th, 2010.
69
64
  Somewhere between 3:40pm and 3:50pm. Alhambra, CA.","thumbnail_url":"http:\/\/i.vimeocdn.com\/video\/97388869_1280.jpg","thumbnail_width":1280,"thumbnail_height":720,"video_id":16010689}'
70
65
  http_version:
71
- recorded_at: Fri, 06 Jun 2014 02:59:55 GMT
66
+ recorded_at: Tue, 10 Jun 2014 19:33:05 GMT
72
67
  recorded_with: VCR 2.9.2
@@ -13,37 +13,37 @@ http_interactions:
13
13
  - "*/*"
14
14
  User-Agent:
15
15
  - Ruby
16
- Host:
17
- - www.youtube.com
18
16
  response:
19
17
  status:
20
18
  code: 404
21
19
  message: Not Found
22
20
  headers:
23
21
  Date:
24
- - Fri, 06 Jun 2014 03:02:54 GMT
22
+ - Tue, 10 Jun 2014 19:33:34 GMT
25
23
  Server:
26
24
  - gwiseguy/2.0
25
+ Expires:
26
+ - Tue, 27 Apr 1971 19:44:06 EST
27
+ X-Frame-Options:
28
+ - ALLOWALL
29
+ Cache-Control:
30
+ - no-cache
31
+ Content-Type:
32
+ - text/html; charset=utf-8
33
+ X-Content-Type-Options:
34
+ - nosniff
27
35
  P3p:
28
36
  - CP="This is not a P3P policy! See http://support.google.com/accounts/bin/answer.py?answer=151657&hl=en
29
37
  for more info."
30
- Content-Type:
31
- - text/html; charset=utf-8
32
- Cache-Control:
33
- - no-cache
34
- X-Frame-Options:
35
- - ALLOWALL
36
- Expires:
37
- - Tue, 27 Apr 1971 19:44:06 EST
38
38
  X-Xss-Protection:
39
39
  - 1; mode=block; report=https://www.google.com/appserve/security-bugs/log/youtube
40
- X-Content-Type-Options:
41
- - nosniff
42
40
  Content-Length:
43
41
  - '9'
42
+ Alternate-Protocol:
43
+ - 443:quic
44
44
  body:
45
45
  encoding: UTF-8
46
46
  string: Not Found
47
47
  http_version:
48
- recorded_at: Fri, 06 Jun 2014 03:02:54 GMT
48
+ recorded_at: Tue, 10 Jun 2014 19:33:34 GMT
49
49
  recorded_with: VCR 2.9.2
@@ -13,44 +13,43 @@ http_interactions:
13
13
  - "*/*"
14
14
  User-Agent:
15
15
  - Ruby
16
- Host:
17
- - www.youtube.com
18
16
  response:
19
17
  status:
20
18
  code: 200
21
19
  message: OK
22
20
  headers:
23
21
  Date:
24
- - Fri, 06 Jun 2014 02:59:55 GMT
22
+ - Tue, 10 Jun 2014 19:33:02 GMT
25
23
  Server:
26
24
  - gwiseguy/2.0
27
- Cache-Control:
28
- - no-cache
29
- X-Frame-Options:
30
- - ALLOWALL
25
+ X-Content-Type-Options:
26
+ - nosniff
31
27
  X-Xss-Protection:
32
28
  - 1; mode=block; report=https://www.google.com/appserve/security-bugs/log/youtube
29
+ P3p:
30
+ - CP="This is not a P3P policy! See http://support.google.com/accounts/bin/answer.py?answer=151657&hl=en
31
+ for more info."
33
32
  Expires:
34
33
  - Tue, 27 Apr 1971 19:44:06 EST
35
- X-Content-Type-Options:
36
- - nosniff
34
+ Cache-Control:
35
+ - no-cache
37
36
  Content-Type:
38
37
  - application/json
39
- P3p:
40
- - CP="This is not a P3P policy! See http://support.google.com/accounts/bin/answer.py?answer=151657&hl=en
41
- for more info."
38
+ X-Frame-Options:
39
+ - ALLOWALL
40
+ Alternate-Protocol:
41
+ - 443:quic
42
42
  Transfer-Encoding:
43
43
  - chunked
44
44
  body:
45
45
  encoding: UTF-8
46
- string: '{"thumbnail_height": 360, "html": "\u003ciframe width=\"480\" height=\"270\"
47
- src=\"http:\/\/www.youtube.com\/embed\/7q5Ltr0qc8c?feature=oembed\" frameborder=\"0\"
48
- allowfullscreen\u003e\u003c\/iframe\u003e", "title": "Billy on the Street:
49
- Amateur Speed Sketching!", "height": 270, "provider_name": "YouTube", "author_url":
50
- "http:\/\/www.youtube.com\/user\/billyonthestreettv", "type": "video", "author_name":
46
+ string: '{"thumbnail_width": 480, "type": "video", "height": 270, "author_name":
51
47
  "billyonthestreettv", "thumbnail_url": "http:\/\/i1.ytimg.com\/vi\/7q5Ltr0qc8c\/hqdefault.jpg",
52
- "provider_url": "http:\/\/www.youtube.com\/", "thumbnail_width": 480, "version":
53
- "1.0", "width": 480}'
48
+ "html": "\u003ciframe width=\"480\" height=\"270\" src=\"http:\/\/www.youtube.com\/embed\/7q5Ltr0qc8c?feature=oembed\"
49
+ frameborder=\"0\" allowfullscreen\u003e\u003c\/iframe\u003e", "title": "Billy
50
+ on the Street: Amateur Speed Sketching!", "author_url": "http:\/\/www.youtube.com\/user\/billyonthestreettv",
51
+ "provider_name": "YouTube", "width": 480, "version": "1.0", "thumbnail_height":
52
+ 360, "provider_url": "http:\/\/www.youtube.com\/"}'
54
53
  http_version:
55
- recorded_at: Fri, 06 Jun 2014 02:59:55 GMT
54
+ recorded_at: Tue, 10 Jun 2014 19:33:02 GMT
56
55
  recorded_with: VCR 2.9.2
@@ -13,37 +13,37 @@ http_interactions:
13
13
  - "*/*"
14
14
  User-Agent:
15
15
  - Ruby
16
- Host:
17
- - www.youtube.com
18
16
  response:
19
17
  status:
20
18
  code: 404
21
19
  message: Not Found
22
20
  headers:
23
21
  Date:
24
- - Fri, 06 Jun 2014 02:59:55 GMT
22
+ - Tue, 10 Jun 2014 19:33:03 GMT
25
23
  Server:
26
24
  - gwiseguy/2.0
27
25
  X-Xss-Protection:
28
26
  - 1; mode=block; report=https://www.google.com/appserve/security-bugs/log/youtube
27
+ P3p:
28
+ - CP="This is not a P3P policy! See http://support.google.com/accounts/bin/answer.py?answer=151657&hl=en
29
+ for more info."
29
30
  Expires:
30
31
  - Tue, 27 Apr 1971 19:44:06 EST
31
32
  X-Content-Type-Options:
32
33
  - nosniff
33
34
  X-Frame-Options:
34
35
  - ALLOWALL
35
- P3p:
36
- - CP="This is not a P3P policy! See http://support.google.com/accounts/bin/answer.py?answer=151657&hl=en
37
- for more info."
38
- Cache-Control:
39
- - no-cache
40
36
  Content-Type:
41
37
  - text/html; charset=utf-8
38
+ Cache-Control:
39
+ - no-cache
42
40
  Content-Length:
43
41
  - '9'
42
+ Alternate-Protocol:
43
+ - 443:quic
44
44
  body:
45
45
  encoding: UTF-8
46
46
  string: Not Found
47
47
  http_version:
48
- recorded_at: Fri, 06 Jun 2014 02:59:55 GMT
48
+ recorded_at: Tue, 10 Jun 2014 19:33:04 GMT
49
49
  recorded_with: VCR 2.9.2
@@ -20,7 +20,7 @@ describe FilmSnob do
20
20
  expect(snob).to be_watchable
21
21
  expect(snob.id).to eq '7q5Ltr0qc8c'
22
22
  expect(snob.site).to eq :youtube
23
- VCR.use_cassette('billy') do
23
+ VCR.use_cassette('youtube/billy') do
24
24
  expect(snob.title).to eq 'Billy on the Street: Amateur Speed Sketching!'
25
25
  end
26
26
  end
@@ -55,7 +55,7 @@ describe FilmSnob do
55
55
  end
56
56
 
57
57
  it 'should raise a not embeddable error for a missing video URL' do
58
- VCR.use_cassette('missing video') do
58
+ VCR.use_cassette('youtube/missing video') do
59
59
  snob = FilmSnob.new("https://youtube.com/watch?v=malformedid")
60
60
  expect{snob.title}.to raise_error(FilmSnob::NotEmbeddableError)
61
61
  end
@@ -67,7 +67,7 @@ describe FilmSnob do
67
67
  snob = FilmSnob.new("https://vimeo.com/16010689")
68
68
  expect(snob.id).to eq '16010689'
69
69
  expect(snob.site).to eq :vimeo
70
- VCR.use_cassette('stephen') do
70
+ VCR.use_cassette('vimeo/stephen') do
71
71
  expect(snob.title).to eq 'Days Like Today'
72
72
  end
73
73
  end
@@ -99,23 +99,61 @@ describe FilmSnob do
99
99
 
100
100
  it 'should allow oembed configuration' do
101
101
  snob = FilmSnob.new("http://vimeo.com/31158841", width: 400)
102
- VCR.use_cassette 'murmuration' do
102
+ VCR.use_cassette('vimeo/murmuration') do
103
103
  expect(snob.html).to match %r{width="400"}
104
104
  end
105
105
 
106
106
  snob2 = FilmSnob.new('http://vimeo.com/31158841', width: 500)
107
- VCR.use_cassette 'murmuration2' do
107
+ VCR.use_cassette('vimeo/murmuration2') do
108
108
  expect(snob2.html).to match %r{width="500"}
109
109
  end
110
110
  end
111
111
  end
112
112
 
113
+
114
+ describe 'dailymotion URLs' do
115
+ it 'should parse https dailymotion URLs' do
116
+ snob = FilmSnob.new("https://www.dailymotion.com/video/xf02xp_uffie-difficult_music")
117
+ expect(snob.id).to eq 'xf02xp_uffie-difficult_music'
118
+ expect(snob.site).to eq :dailymotion
119
+ VCR.use_cassette('dailymotion/music') do
120
+ expect(snob.title).to eq 'Uffie - Difficult'
121
+ end
122
+ end
123
+
124
+ it 'should parse http dailymotion URLs' do
125
+ snob = FilmSnob.new("http://www.dailymotion.com/video/xf02xp_uffie-difficult_music")
126
+ expect(snob.id).to eq 'xf02xp_uffie-difficult_music'
127
+ expect(snob.site).to eq :dailymotion
128
+ end
129
+
130
+ it 'should parse mobile dailymotion URLs' do
131
+ snob = FilmSnob.new("http://touch.dailymotion.com/video/xf02xp_uffie-difficult_music")
132
+ expect(snob.id).to eq 'xf02xp_uffie-difficult_music'
133
+ expect(snob.site).to eq :dailymotion
134
+ expect(snob.clean_url).to eq 'https://www.dailymotion.com/video/xf02xp_uffie-difficult_music'
135
+ end
136
+
137
+ it 'should allow oembed configuration' do
138
+ snob = FilmSnob.new("http://www.dailymotion.com/video/xf02xp_uffie-difficult_music", maxwidth: 400)
139
+ VCR.use_cassette('dailymotion/music1') do
140
+ expect(snob.html).to match %r{width="400"}
141
+ end
142
+
143
+ snob2 = FilmSnob.new('http://www.dailymotion.com/video/xf02xp_uffie-difficult_music', maxwidth: 500)
144
+ VCR.use_cassette('dailymotion/music500') do
145
+ expect(snob2.html).to match %r{width="500"}
146
+ end
147
+ end
148
+ end
149
+
150
+
113
151
  describe 'hulu URLs' do
114
152
  it 'should parse hulu URLs' do
115
153
  snob = FilmSnob.new("http://www.hulu.com/watch/285095")
116
154
  expect(snob.id).to eq '285095'
117
155
  expect(snob.site).to eq :hulu
118
- VCR.use_cassette('harmon') do
156
+ VCR.use_cassette('hulu/harmon') do
119
157
  expect(snob.title).to eq 'Remedial Chaos Theory (Community)'
120
158
  expect{snob.html}.not_to raise_error
121
159
  end
@@ -127,19 +165,56 @@ describe FilmSnob do
127
165
  film = FilmSnob.new('http://www.funnyordie.com/videos/8db066d2e0/the-live-read-of-space-jam-with-blake-griffin')
128
166
  expect(film.id).to eq '8db066d2e0'
129
167
  expect(film.site).to eq :funnyordie
130
- VCR.use_cassette 'space jam' do
168
+ VCR.use_cassette 'funnyordie/space jam' do
131
169
  expect(film.title).to eq 'The Live Read of Space Jam with Blake Griffin'
132
170
  expect{film.html}.not_to raise_error
133
171
  end
134
172
  end
135
173
  end
136
174
 
175
+ describe 'instagram URLs' do
176
+ it 'should parse normal instagram URLs' do
177
+ film = FilmSnob.new("http://instagram.com/p/oBkLq7hnDP/")
178
+ expect(film.id).to eq 'oBkLq7hnDP'
179
+ expect(film.site).to eq :instagram
180
+ VCR.use_cassette 'instagram/sphynx cat' do
181
+ expect(film.title).to match "Very stupid package!"
182
+ expect{film.html}.not_to raise_error
183
+ end
184
+ end
185
+ it 'should handle https urls' do
186
+ film = FilmSnob.new("https://instagram.com/p/otxnbOocqJ/")
187
+ expect(film).to be_watchable
188
+ expect(film.site).to eq :instagram
189
+ expect(film.id).to eq 'otxnbOocqJ'
190
+ end
191
+ it 'should handle instagr.am urls' do
192
+ film = FilmSnob.new("http://instagr.am/p/otxnbOocqJ/")
193
+ expect(film).to be_watchable
194
+ expect(film.site).to eq :instagram
195
+ expect(film.id).to eq 'otxnbOocqJ'
196
+ end
197
+ it 'should handle https instagr.am urls' do
198
+ film = FilmSnob.new("https://instagr.am/p/otxnbOocqJ/")
199
+ expect(film).to be_watchable
200
+ expect(film.site).to eq :instagram
201
+ expect(film.id).to eq 'otxnbOocqJ'
202
+ end
203
+ it 'should raise error when the URL is not embeddable' do
204
+ film = FilmSnob.new('http://instagram.com/p/nothinghere/')
205
+ VCR.use_cassette 'instagram/nothing' do
206
+ expect { film.html }.to raise_error FilmSnob::NotEmbeddableError
207
+ expect { film.title }.to raise_error FilmSnob::NotEmbeddableError
208
+ end
209
+ end
210
+ end
211
+
137
212
  describe 'coub URLs' do
138
213
  it 'should parse coub URLs' do
139
214
  film = FilmSnob.new('http://coub.com/view/rcd14cm')
140
215
  expect(film.id).to eq 'rcd14cm'
141
216
  expect(film.site).to eq :coub
142
- VCR.use_cassette 'voodoo_people' do
217
+ VCR.use_cassette 'coub/voodoo_people' do
143
218
  expect(film.title).to eq 'voodoo people'
144
219
  expect{film.html}.not_to raise_error
145
220
  end
data/spec/youtube_spec.rb CHANGED
@@ -2,7 +2,7 @@ require_relative 'spec_helper'
2
2
 
3
3
  describe FilmSnob::YouTube do
4
4
  it 'may not be embeddable' do
5
- VCR.use_cassette('bad_youtube_url') do
5
+ VCR.use_cassette('youtube/bad_youtube_url') do
6
6
  snob = FilmSnob.new('http://youtube.com/watch?v=malformedid')
7
7
  expect{snob.html}.to raise_error(FilmSnob::NotEmbeddableError)
8
8
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: film_snob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
5
- prerelease:
4
+ version: 0.3.10
6
5
  platform: ruby
7
6
  authors:
8
7
  - Max Jacobson
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-06-06 00:00:00.000000000 Z
11
+ date: 2014-06-14 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: webmock
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: vcr
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: pry
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -125,63 +112,72 @@ files:
125
112
  - film_snob.gemspec
126
113
  - lib/film_snob.rb
127
114
  - lib/film_snob/coub.rb
115
+ - lib/film_snob/dailymotion.rb
128
116
  - lib/film_snob/exceptions.rb
129
117
  - lib/film_snob/funny_or_die.rb
130
118
  - lib/film_snob/hulu.rb
119
+ - lib/film_snob/instagram.rb
131
120
  - lib/film_snob/url_to_video.rb
132
121
  - lib/film_snob/version.rb
133
122
  - lib/film_snob/video_site.rb
134
123
  - lib/film_snob/vimeo.rb
135
124
  - lib/film_snob/youtube.rb
136
- - spec/cassettes/.keep
137
- - spec/cassettes/bad_youtube_url.yml
138
- - spec/cassettes/billy.yml
139
- - spec/cassettes/harmon.yml
140
- - spec/cassettes/missing_video.yml
141
- - spec/cassettes/murmuration.yml
142
- - spec/cassettes/murmuration2.yml
143
- - spec/cassettes/space_jam.yml
144
- - spec/cassettes/stephen.yml
145
- - spec/cassettes/voodoo_people.yml
125
+ - spec/cassettes/coub/voodoo_people.yml
126
+ - spec/cassettes/dailymotion/music.yml
127
+ - spec/cassettes/dailymotion/music1.yml
128
+ - spec/cassettes/dailymotion/music500.yml
129
+ - spec/cassettes/funnyordie/space_jam.yml
130
+ - spec/cassettes/hulu/harmon.yml
131
+ - spec/cassettes/instagram/nothing.yml
132
+ - spec/cassettes/instagram/sphynx_cat.yml
133
+ - spec/cassettes/vimeo/murmuration.yml
134
+ - spec/cassettes/vimeo/murmuration2.yml
135
+ - spec/cassettes/vimeo/stephen.yml
136
+ - spec/cassettes/youtube/bad_youtube_url.yml
137
+ - spec/cassettes/youtube/billy.yml
138
+ - spec/cassettes/youtube/missing_video.yml
146
139
  - spec/film_snob_spec.rb
147
140
  - spec/spec_helper.rb
148
141
  - spec/youtube_spec.rb
149
142
  homepage: https://github.com/maxjacobson/film_snob
150
143
  licenses:
151
144
  - MIT
145
+ metadata: {}
152
146
  post_install_message:
153
147
  rdoc_options: []
154
148
  require_paths:
155
149
  - lib
156
150
  required_ruby_version: !ruby/object:Gem::Requirement
157
- none: false
158
151
  requirements:
159
- - - ! '>='
152
+ - - '>='
160
153
  - !ruby/object:Gem::Version
161
154
  version: 1.9.3
162
155
  required_rubygems_version: !ruby/object:Gem::Requirement
163
- none: false
164
156
  requirements:
165
- - - ! '>='
157
+ - - '>='
166
158
  - !ruby/object:Gem::Version
167
159
  version: '0'
168
160
  requirements: []
169
161
  rubyforge_project:
170
- rubygems_version: 1.8.23.2
162
+ rubygems_version: 2.2.2
171
163
  signing_key:
172
- specification_version: 3
164
+ specification_version: 4
173
165
  summary: Fetch embed codes for videos
174
166
  test_files:
175
- - spec/cassettes/.keep
176
- - spec/cassettes/bad_youtube_url.yml
177
- - spec/cassettes/billy.yml
178
- - spec/cassettes/harmon.yml
179
- - spec/cassettes/missing_video.yml
180
- - spec/cassettes/murmuration.yml
181
- - spec/cassettes/murmuration2.yml
182
- - spec/cassettes/space_jam.yml
183
- - spec/cassettes/stephen.yml
184
- - spec/cassettes/voodoo_people.yml
167
+ - spec/cassettes/coub/voodoo_people.yml
168
+ - spec/cassettes/dailymotion/music.yml
169
+ - spec/cassettes/dailymotion/music1.yml
170
+ - spec/cassettes/dailymotion/music500.yml
171
+ - spec/cassettes/funnyordie/space_jam.yml
172
+ - spec/cassettes/hulu/harmon.yml
173
+ - spec/cassettes/instagram/nothing.yml
174
+ - spec/cassettes/instagram/sphynx_cat.yml
175
+ - spec/cassettes/vimeo/murmuration.yml
176
+ - spec/cassettes/vimeo/murmuration2.yml
177
+ - spec/cassettes/vimeo/stephen.yml
178
+ - spec/cassettes/youtube/bad_youtube_url.yml
179
+ - spec/cassettes/youtube/billy.yml
180
+ - spec/cassettes/youtube/missing_video.yml
185
181
  - spec/film_snob_spec.rb
186
182
  - spec/spec_helper.rb
187
183
  - spec/youtube_spec.rb
data/spec/cassettes/.keep DELETED
File without changes