oh-my-embed 1.2.0 → 1.2.1
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 +4 -4
- data/README.md +4 -0
- data/lib/oh_my_embed/crawler.rb +1 -1
- data/lib/oh_my_embed/providers/dailymotion.rb +14 -0
- data/lib/oh_my_embed/providers/deviant_art.rb +20 -0
- data/lib/oh_my_embed/providers/viddler.rb +17 -0
- data/lib/oh_my_embed/providers/vimeo.rb +18 -0
- data/lib/oh_my_embed/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/dailymotion.yml +66 -0
- data/spec/fixtures/vcr_cassettes/deviantart.yml +51 -0
- data/spec/fixtures/vcr_cassettes/viddler.yml +46 -0
- data/spec/fixtures/vcr_cassettes/vimeo.yml +97 -0
- data/spec/oh_my_embed/crawler_spec.rb +7 -0
- data/spec/oh_my_embed/providers/dailymotion_spec.rb +44 -0
- data/spec/oh_my_embed/providers/deviant_art_spec.rb +44 -0
- data/spec/oh_my_embed/providers/viddler_spec.rb +44 -0
- data/spec/oh_my_embed/providers/vimeo_spec.rb +44 -0
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89c37021a9fcbf572c38cb805bc16125e7fc3cdc
|
4
|
+
data.tar.gz: ad251a0c53e9bac5bf6e4a2c860cd2cde4d4f49f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dea8f269874194cdb0988b7cbd66b1dbf627ca2da19892b5b3c8c63a7a38604bb04c2a71bdd775860f62f97dddc3dc54c8e70266c1fe7a00eb633b05bce456cf
|
7
|
+
data.tar.gz: 666b58038e8f7fa796504f39ea9906fb4ebfea37a78cff6e4d14fe00a0997d45f1de4aa7db101f55c0feee457e558bc67430bdb9a2ec25047fd1adbfa524d42b
|
data/README.md
CHANGED
@@ -36,6 +36,10 @@ Or install it yourself as:
|
|
36
36
|
- SoundCloud
|
37
37
|
- Kickstarter
|
38
38
|
- Spotify
|
39
|
+
- Dailymotion
|
40
|
+
- Viddler
|
41
|
+
- Vimeo
|
42
|
+
- DeviantArt
|
39
43
|
|
40
44
|
If you need some other providers feel free to add them via pull request or build it for your application only by using the `OhMyEmbed::Provider` base class.
|
41
45
|
See the custom provider section for more informations.
|
data/lib/oh_my_embed/crawler.rb
CHANGED
@@ -23,7 +23,7 @@ module OhMyEmbed
|
|
23
23
|
def register(provider)
|
24
24
|
if provider.is_a? Symbol
|
25
25
|
begin
|
26
|
-
provider = OhMyEmbed::Providers.const_get(provider.to_s.
|
26
|
+
provider = OhMyEmbed::Providers.const_get(provider.to_s.camelize)
|
27
27
|
rescue NameError
|
28
28
|
raise OhMyEmbed::UnknownProvider.new(provider)
|
29
29
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module OhMyEmbed
|
2
|
+
module Providers
|
3
|
+
class Dailymotion < OhMyEmbed::Provider
|
4
|
+
# Dailymotion oembed documentation:
|
5
|
+
# https://developer.dailymotion.com/player
|
6
|
+
|
7
|
+
self.endpoint = 'https://www.dailymotion.com/services/oembed'
|
8
|
+
self.schemes = [
|
9
|
+
'//dailymotion.com/video/*',
|
10
|
+
'//*.dailymotion.com/video/*',
|
11
|
+
]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module OhMyEmbed
|
2
|
+
module Providers
|
3
|
+
class DeviantArt < OhMyEmbed::Provider
|
4
|
+
# DeviantArt oembed documentation:
|
5
|
+
# https://www.deviantart.com/developers/oembed
|
6
|
+
|
7
|
+
self.endpoint = 'http://backend.deviantart.com/oembed'
|
8
|
+
self.schemes = [
|
9
|
+
'//*.deviantart.com/art/*',
|
10
|
+
'//deviantart.com/art/*',
|
11
|
+
'//*.deviantart.com/*#/d*',
|
12
|
+
'//deviantart.com/*#/d*',
|
13
|
+
'//fav.me/*',
|
14
|
+
'//*.fav.me/*',
|
15
|
+
'//sta.sh/*',
|
16
|
+
'//*.sta.sh/*'
|
17
|
+
]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module OhMyEmbed
|
2
|
+
module Providers
|
3
|
+
class Viddler < OhMyEmbed::Provider
|
4
|
+
# Viddler oembed documentation:
|
5
|
+
# http://developers.viddler.com/#liverail-integration
|
6
|
+
|
7
|
+
self.endpoint = 'http://www.viddler.com/oembed/'
|
8
|
+
self.schemes = [
|
9
|
+
'//www.viddler.com/v/*',
|
10
|
+
]
|
11
|
+
|
12
|
+
self.custom_mapping = {
|
13
|
+
'author.name' => 'author_name ',
|
14
|
+
}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module OhMyEmbed
|
2
|
+
module Providers
|
3
|
+
class Vimeo < OhMyEmbed::Provider
|
4
|
+
# Vimeo oembed documentation:
|
5
|
+
# https://developer.vimeo.com/apis/oembed
|
6
|
+
|
7
|
+
self.endpoint = 'https://vimeo.com/api/oembed.json'
|
8
|
+
self.schemes = [
|
9
|
+
'//vimeo.com/*',
|
10
|
+
'//*.vimeo.com/*',
|
11
|
+
'//vimeo.com/channels/*/*',
|
12
|
+
'//*.vimeo.com/channels/*/*',
|
13
|
+
'//vimeo.com/groups/*/videos/*',
|
14
|
+
'//*.vimeo.com/groups/*/videos/*',
|
15
|
+
]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/oh_my_embed/version.rb
CHANGED
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://www.dailymotion.com/services/oembed?format=json&url=http://www.dailymotion.com/video/x49ug8z_faszination-pferderennen-heute-eine-schule-fur-den-jockey-nachwuchs_sport
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Ruby/2.2.3
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
Host:
|
17
|
+
- www.dailymotion.com
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- DMS/1.0.42
|
25
|
+
X-Dm-Backnode:
|
26
|
+
- 10.194.151.123:80
|
27
|
+
Vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
Cache-Control:
|
30
|
+
- no-cache
|
31
|
+
Content-Type:
|
32
|
+
- application/json
|
33
|
+
Access-Control-Expose-Headers:
|
34
|
+
- X-DM-BackNode-Response-Time
|
35
|
+
Date:
|
36
|
+
- Wed, 11 May 2016 12:50:08 GMT
|
37
|
+
Keep-Alive:
|
38
|
+
- timeout=60, max=4995
|
39
|
+
X-Dm-Lb-Ip:
|
40
|
+
- 195.8.215.136
|
41
|
+
X-Dm-Lb-Name:
|
42
|
+
- lb-09
|
43
|
+
X-Dm-Backnode-Response-Time:
|
44
|
+
- '45'
|
45
|
+
Connection:
|
46
|
+
- Keep-Alive
|
47
|
+
Set-Cookie:
|
48
|
+
- ts=411684; expires=Mon, 11-May-2026 12:50:08 GMT; Max-Age=315532800; path=/;
|
49
|
+
domain=.dailymotion.com
|
50
|
+
- v1st=BA6DCC745E462A37902E541FF45BFF3B; expires=Thu, 11 May 2017 12:50:08 GMT;
|
51
|
+
max-age=31536000; path=/; domain=.dailymotion.com
|
52
|
+
X-Dm-Page:
|
53
|
+
- de.html.oembed
|
54
|
+
Content-Length:
|
55
|
+
- '372'
|
56
|
+
body:
|
57
|
+
encoding: ASCII-8BIT
|
58
|
+
string: '{"type":"video","version":"1.0","provider_name":"Dailymotion","provider_url":"https:\/\/www.dailymotion.com","title":"Faszination
|
59
|
+
Pferderennen - Heute: Eine Schule f\u00fcr den Jockey-Nachwuchs","description":"In
|
60
|
+
K\u00f6ln gibt es eine Schule f\u00fcr den Jockey-Nachwuchs im Pferdesport.","author_name":"A
|
61
|
+
Group","author_url":"https:\/\/www.dailymotion.com\/auer1","width":480,"height":269,"html":"<iframe
|
62
|
+
frameborder=\"0\" width=\"480\" height=\"269\" src=\"https:\/\/www.dailymotion.com\/embed\/video\/x49ug8z\"
|
63
|
+
allowfullscreen><\/iframe>","thumbnail_url":"https:\/\/s2-ssl.dmcdn.net\/XDvvJ\/x240-cMm.jpg","thumbnail_width":427,"thumbnail_height":240}'
|
64
|
+
http_version:
|
65
|
+
recorded_at: Wed, 11 May 2016 12:50:08 GMT
|
66
|
+
recorded_with: VCR 3.0.1
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://backend.deviantart.com/oembed?format=json&url=http://fav.me/d2enxz7
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Ruby/2.2.3
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
Host:
|
17
|
+
- backend.deviantart.com
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Content-Type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
Content-Length:
|
26
|
+
- '604'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Cache-Control:
|
30
|
+
- max-age=180
|
31
|
+
Date:
|
32
|
+
- Wed, 11 May 2016 14:08:59 GMT
|
33
|
+
Expires:
|
34
|
+
- Wed, 11 May 2016 14:11:59 GMT
|
35
|
+
Server:
|
36
|
+
- Apache
|
37
|
+
Vary:
|
38
|
+
- Accept-Encoding
|
39
|
+
X-Cache:
|
40
|
+
- Miss from cloudfront
|
41
|
+
Via:
|
42
|
+
- 1.1 3a3025640eaad9970531c0d9450c1606.cloudfront.net (CloudFront)
|
43
|
+
X-Amz-Cf-Id:
|
44
|
+
- VnKocR5x0lg8SelfMZVAXiVvRe1jVmYSZvifDQDJNxc-BG-MWy6BZw==
|
45
|
+
body:
|
46
|
+
encoding: ASCII-8BIT
|
47
|
+
string: '{"version":"1.0","type":"photo","title":"Cope","category":"Digital
|
48
|
+
Art > Drawings & Paintings > Illustrations > Conceptual","url":"http:\/\/orig03.deviantart.net\/3c1c\/f\/2009\/336\/4\/7\/cope_by_pachunka.jpg","author_name":"Pachunka","author_url":"http:\/\/Pachunka.deviantart.com","provider_name":"DeviantArt","provider_url":"http:\/\/www.deviantart.com","safety":"nonadult","pubdate":"2009-12-02T23:59:51-08:00","community":{"statistics":{"_attributes":{"views":1326,"favorites":5,"comments":5,"downloads":59}}},"copyright":{"_attributes":{"url":"http:\/\/Pachunka.deviantart.com","year":"2009","entity":"Pachunka"}},"width":"448","height":"672","imagetype":"jpg","thumbnail_url":"http:\/\/t10.deviantart.net\/nHw1FLNfxnT4ga1BPKmlV3V7h2E=\/fit-in\/300x900\/filters:no_upscale():origin()\/pre11\/dde3\/th\/pre\/f\/2009\/336\/4\/7\/cope_by_pachunka.jpg","thumbnail_width":300,"thumbnail_height":450,"thumbnail_url_150":"http:\/\/t08.deviantart.net\/vVG89JdVpkScdywi4UoX87Htfdg=\/fit-in\/150x150\/filters:no_upscale():origin()\/pre11\/dde3\/th\/pre\/f\/2009\/336\/4\/7\/cope_by_pachunka.jpg","thumbnail_url_200h":"http:\/\/t01.deviantart.net\/KOxWveFcueoTEaYgA_GBLfFMisg=\/300x200\/filters:fixed_height(100,100):origin()\/pre11\/dde3\/th\/pre\/f\/2009\/336\/4\/7\/cope_by_pachunka.jpg","thumbnail_width_200h":133,"thumbnail_height_200h":200}'
|
49
|
+
http_version:
|
50
|
+
recorded_at: Wed, 11 May 2016 14:08:59 GMT
|
51
|
+
recorded_with: VCR 3.0.1
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.viddler.com/oembed/?format=json&url=http://www.viddler.com/v/bdce8c7
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Ruby/2.2.3
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
Host:
|
17
|
+
- www.viddler.com
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Date:
|
26
|
+
- Wed, 11 May 2016 13:28:35 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json;charset=UTF-8
|
29
|
+
Content-Length:
|
30
|
+
- '478'
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
X-Viddler-Node:
|
34
|
+
- viddler_c
|
35
|
+
Set-Cookie:
|
36
|
+
- JSESSIONID=1A72ECBFBA6297FBAA981A665FEEA6F3.viddler_c; Domain=.viddler.com;
|
37
|
+
Path=/logged/; HttpOnly
|
38
|
+
body:
|
39
|
+
encoding: UTF-8
|
40
|
+
string: '{"type":"video","version":"1.0","provider_name":"Viddler","provider_url":"http://www.viddler.com/","title":"Viddler
|
41
|
+
Platform Overview","author_name ":"viddler","author_url":"http://viddler.com","thumbnail_url":"http://thumbs.cdn-ec.viddler.com/thumbnail_2_bdce8c7_v8.jpg","thumbnail_width":620,"thumbnail_height":349,"html":"<iframe
|
42
|
+
width=\"620\" height=\"349\" src=\"http://www.viddler.com/embed/bdce8c7\"
|
43
|
+
frameborder=\"0\" allowfullscreen><\/iframe>","width":620,"height":349}'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Wed, 11 May 2016 13:28:35 GMT
|
46
|
+
recorded_with: VCR 3.0.1
|
@@ -0,0 +1,97 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://vimeo.com/api/oembed.json?format=json&url=https://vimeo.com/76979871
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Ruby/2.2.3
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
Host:
|
17
|
+
- vimeo.com
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Content-Type:
|
26
|
+
- application/json
|
27
|
+
Access-Control-Allow-Origin:
|
28
|
+
- "*"
|
29
|
+
Access-Control-Allow-Headers:
|
30
|
+
- X-Requested-With
|
31
|
+
X-Content-Type-Options:
|
32
|
+
- nosniff
|
33
|
+
X-Frame-Options:
|
34
|
+
- sameorigin
|
35
|
+
Cache-Control:
|
36
|
+
- max-age=60
|
37
|
+
Expires:
|
38
|
+
- Wed, 11 May 2016 13:42:22 GMT
|
39
|
+
Last-Modified:
|
40
|
+
- Wed, 11 May 2016 12:54:52 GMT
|
41
|
+
Etag:
|
42
|
+
- '"9b7fb93c2f1e80224398c6ba991977f6244a2902"'
|
43
|
+
X-Ua-Compatible:
|
44
|
+
- IE=edge
|
45
|
+
X-Xss-Protection:
|
46
|
+
- 1; mode=block
|
47
|
+
Strict-Transport-Security:
|
48
|
+
- max-age=15120000; includeSubDomains; preload
|
49
|
+
Content-Security-Policy-Report-Only:
|
50
|
+
- 'default-src https: data: blob: ''unsafe-inline'' ''unsafe-eval''; report-uri
|
51
|
+
/_csp'
|
52
|
+
Via:
|
53
|
+
- 1.1 varnish
|
54
|
+
- 1.1 varnish
|
55
|
+
Fastly-Debug-Digest:
|
56
|
+
- e148781371e0d734aef68bed9616522d87baa1afd00efbfd4e7ba101ae5e2d4a
|
57
|
+
Content-Length:
|
58
|
+
- '845'
|
59
|
+
Accept-Ranges:
|
60
|
+
- bytes
|
61
|
+
Date:
|
62
|
+
- Wed, 11 May 2016 13:41:22 GMT
|
63
|
+
Age:
|
64
|
+
- '0'
|
65
|
+
Connection:
|
66
|
+
- keep-alive
|
67
|
+
X-Served-By:
|
68
|
+
- cache-iad2121-IAD, cache-fra1228-FRA
|
69
|
+
X-Cache:
|
70
|
+
- MISS, MISS
|
71
|
+
X-Cache-Hits:
|
72
|
+
- 0, 0
|
73
|
+
X-Timer:
|
74
|
+
- S1462974082.558658,VS0,VE125
|
75
|
+
Vary:
|
76
|
+
- User-Agent,Accept-Encoding
|
77
|
+
body:
|
78
|
+
encoding: ASCII-8BIT
|
79
|
+
string: '{"type":"video","version":"1.0","provider_name":"Vimeo","provider_url":"https:\/\/vimeo.com\/","title":"The
|
80
|
+
New Vimeo Player (You Know, For Videos)","author_name":"Vimeo Staff","author_url":"https:\/\/vimeo.com\/staff","is_plus":"0","html":"<iframe
|
81
|
+
src=\"https:\/\/player.vimeo.com\/video\/76979871\" width=\"1280\" height=\"720\"
|
82
|
+
frameborder=\"0\" title=\"The New Vimeo Player (You Know, For Videos)\" webkitallowfullscreen
|
83
|
+
mozallowfullscreen allowfullscreen><\/iframe>","width":1280,"height":720,"duration":62,"description":"It
|
84
|
+
may look (mostly) the same on the surface, but under the hood we totally rebuilt
|
85
|
+
our player. Here\u2019s a quick rundown of some of the coolest new features:\n\n\u2022
|
86
|
+
Lightning fast playback\n\u2022 Redesigned Share screen\n\u2022 Closed caption
|
87
|
+
and subtitle compatible\n\u2022 HTML5 by default\n\u2022 Purchase-from-player
|
88
|
+
functionality for embedded Vimeo On Demand trailers\n\u2022 More responsive
|
89
|
+
than ever (go ahead, resize it, we dare you!!!)\n\nWe\u2019re really proud
|
90
|
+
of these updates. So proud that we made a spiffy new page to showcase all
|
91
|
+
the reasons why we have the best video player in the galaxy. Check it out
|
92
|
+
here: http:\/\/vimeo.com\/player\n\nIn short, this is a player that even haters
|
93
|
+
can love.","thumbnail_url":"https:\/\/i.vimeocdn.com\/video\/452001751_1280.jpg","thumbnail_width":1280,"thumbnail_height":720,"thumbnail_url_with_play_button":"https:\/\/i.vimeocdn.com\/filter\/overlay?src=https:\/\/i.vimeocdn.com\/video\/452001751_1280.jpg&src=http:\/\/f.vimeocdn.com\/p\/images\/crawler_play.png","upload_date":"2013-10-15
|
94
|
+
14:08:29","video_id":76979871,"uri":"\/videos\/76979871"}'
|
95
|
+
http_version:
|
96
|
+
recorded_at: Wed, 11 May 2016 13:41:22 GMT
|
97
|
+
recorded_with: VCR 3.0.1
|
@@ -40,6 +40,13 @@ describe OhMyEmbed::Crawler do
|
|
40
40
|
expect(crawler.providers.first).to be OhMyEmbed::Providers::BuiltInDummy
|
41
41
|
end
|
42
42
|
|
43
|
+
it 'it add a plural named provider class to the providers list' do
|
44
|
+
class OhMyEmbed::Providers::MyPosts < OhMyEmbed::Provider; end
|
45
|
+
|
46
|
+
expect{ crawler.register(:my_posts) }.to change{ crawler.providers.count }.from(0).to(1)
|
47
|
+
expect(crawler.providers.first).to be OhMyEmbed::Providers::MyPosts
|
48
|
+
end
|
49
|
+
|
43
50
|
it 'raises an error if no provider class found' do
|
44
51
|
expect{ crawler.register :yolo }.to raise_error OhMyEmbed::UnknownProvider
|
45
52
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe OhMyEmbed::Providers::Dailymotion do
|
4
|
+
let(:provider) { OhMyEmbed::Providers::Dailymotion }
|
5
|
+
let(:content_url) { 'http://www.dailymotion.com/video/x49ug8z_faszination-pferderennen-heute-eine-schule-fur-den-jockey-nachwuchs_sport' }
|
6
|
+
|
7
|
+
it 'the content_url matches the schema' do
|
8
|
+
expect(provider.regex).to match content_url
|
9
|
+
end
|
10
|
+
|
11
|
+
describe 'fetching' do
|
12
|
+
it 'returns a video response with required attributes' do
|
13
|
+
VCR.use_cassette('dailymotion') do
|
14
|
+
response = provider.fetch(content_url)
|
15
|
+
|
16
|
+
expect(response).to be_a OhMyEmbed::Response
|
17
|
+
|
18
|
+
expect(response.type).to eq :video
|
19
|
+
|
20
|
+
expect(response.provider_name).to eq 'Dailymotion'
|
21
|
+
expect(response.provider_url).to eq 'https://www.dailymotion.com'
|
22
|
+
|
23
|
+
expect(response.url).to eq content_url
|
24
|
+
|
25
|
+
expect(response.title).to eq 'Faszination Pferderennen - Heute: Eine Schule für den Jockey-Nachwuchs'
|
26
|
+
|
27
|
+
expect(response.author).to eq({
|
28
|
+
name: 'A Group',
|
29
|
+
url: 'https://www.dailymotion.com/auer1',
|
30
|
+
})
|
31
|
+
|
32
|
+
expect(response.thumbnail).to eq({
|
33
|
+
url: 'https://s2-ssl.dmcdn.net/XDvvJ/x240-cMm.jpg',
|
34
|
+
width: 427,
|
35
|
+
height: 240,
|
36
|
+
})
|
37
|
+
|
38
|
+
expect(response.embed[:html]).to be_a String
|
39
|
+
expect(response.embed[:width]).to eq 480
|
40
|
+
expect(response.embed[:height]).to eq 269
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe OhMyEmbed::Providers::DeviantArt do
|
4
|
+
let(:provider) { OhMyEmbed::Providers::DeviantArt }
|
5
|
+
let(:content_url) { 'http://fav.me/d2enxz7' }
|
6
|
+
|
7
|
+
it 'the content_url matches the schema' do
|
8
|
+
expect(provider.regex).to match content_url
|
9
|
+
end
|
10
|
+
|
11
|
+
describe 'fetching' do
|
12
|
+
it 'returns a video response with required attributes' do
|
13
|
+
VCR.use_cassette('deviantart') do
|
14
|
+
response = provider.fetch(content_url)
|
15
|
+
|
16
|
+
expect(response).to be_a OhMyEmbed::Response
|
17
|
+
|
18
|
+
expect(response.type).to eq :photo
|
19
|
+
|
20
|
+
expect(response.provider_name).to eq 'DeviantArt'
|
21
|
+
expect(response.provider_url).to eq 'http://www.deviantart.com'
|
22
|
+
|
23
|
+
expect(response.url).to eq 'http://orig03.deviantart.net/3c1c/f/2009/336/4/7/cope_by_pachunka.jpg'
|
24
|
+
|
25
|
+
expect(response.title).to eq 'Cope'
|
26
|
+
|
27
|
+
expect(response.author).to eq({
|
28
|
+
name: 'Pachunka',
|
29
|
+
url: 'http://Pachunka.deviantart.com',
|
30
|
+
})
|
31
|
+
|
32
|
+
expect(response.thumbnail).to eq({
|
33
|
+
url: 'http://t10.deviantart.net/nHw1FLNfxnT4ga1BPKmlV3V7h2E=/fit-in/300x900/filters:no_upscale():origin()/pre11/dde3/th/pre/f/2009/336/4/7/cope_by_pachunka.jpg',
|
34
|
+
width: 300,
|
35
|
+
height: 450,
|
36
|
+
})
|
37
|
+
|
38
|
+
expect(response.embed[:html]).to be nil
|
39
|
+
expect(response.embed[:width]).to eq '448'
|
40
|
+
expect(response.embed[:height]).to eq '672'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe OhMyEmbed::Providers::Viddler do
|
4
|
+
let(:provider) { OhMyEmbed::Providers::Viddler }
|
5
|
+
let(:content_url) { 'http://www.viddler.com/v/bdce8c7' }
|
6
|
+
|
7
|
+
it 'the content_url matches the schema' do
|
8
|
+
expect(provider.regex).to match content_url
|
9
|
+
end
|
10
|
+
|
11
|
+
describe 'fetching' do
|
12
|
+
it 'returns a video response with required attributes' do
|
13
|
+
VCR.use_cassette('viddler') do
|
14
|
+
response = provider.fetch(content_url)
|
15
|
+
|
16
|
+
expect(response).to be_a OhMyEmbed::Response
|
17
|
+
|
18
|
+
expect(response.type).to eq :video
|
19
|
+
|
20
|
+
expect(response.provider_name).to eq 'Viddler'
|
21
|
+
expect(response.provider_url).to eq 'http://www.viddler.com/'
|
22
|
+
|
23
|
+
expect(response.url).to eq content_url
|
24
|
+
|
25
|
+
expect(response.title).to eq 'Viddler Platform Overview'
|
26
|
+
|
27
|
+
expect(response.author).to eq({
|
28
|
+
name: 'viddler',
|
29
|
+
url: 'http://viddler.com',
|
30
|
+
})
|
31
|
+
|
32
|
+
expect(response.thumbnail).to eq({
|
33
|
+
url: 'http://thumbs.cdn-ec.viddler.com/thumbnail_2_bdce8c7_v8.jpg',
|
34
|
+
width: 620,
|
35
|
+
height: 349,
|
36
|
+
})
|
37
|
+
|
38
|
+
expect(response.embed[:html]).to be_a String
|
39
|
+
expect(response.embed[:width]).to eq 620
|
40
|
+
expect(response.embed[:height]).to eq 349
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe OhMyEmbed::Providers::Vimeo do
|
4
|
+
let(:provider) { OhMyEmbed::Providers::Vimeo }
|
5
|
+
let(:content_url) { 'https://vimeo.com/76979871' }
|
6
|
+
|
7
|
+
it 'the content_url matches the schema' do
|
8
|
+
expect(provider.regex).to match content_url
|
9
|
+
end
|
10
|
+
|
11
|
+
describe 'fetching' do
|
12
|
+
it 'returns a video response with required attributes' do
|
13
|
+
VCR.use_cassette('vimeo') do
|
14
|
+
response = provider.fetch(content_url)
|
15
|
+
|
16
|
+
expect(response).to be_a OhMyEmbed::Response
|
17
|
+
|
18
|
+
expect(response.type).to eq :video
|
19
|
+
|
20
|
+
expect(response.provider_name).to eq 'Vimeo'
|
21
|
+
expect(response.provider_url).to eq 'https://vimeo.com/'
|
22
|
+
|
23
|
+
expect(response.url).to eq content_url
|
24
|
+
|
25
|
+
expect(response.title).to eq 'The New Vimeo Player (You Know, For Videos)'
|
26
|
+
|
27
|
+
expect(response.author).to eq({
|
28
|
+
name: 'Vimeo Staff',
|
29
|
+
url: 'https://vimeo.com/staff',
|
30
|
+
})
|
31
|
+
|
32
|
+
expect(response.thumbnail).to eq({
|
33
|
+
url: 'https://i.vimeocdn.com/video/452001751_1280.jpg',
|
34
|
+
width: 1280,
|
35
|
+
height: 720,
|
36
|
+
})
|
37
|
+
|
38
|
+
expect(response.embed[:html]).to be_a String
|
39
|
+
expect(response.embed[:width]).to eq 1280
|
40
|
+
expect(response.embed[:height]).to eq 720
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oh-my-embed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Axel Wahlen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -145,6 +145,8 @@ files:
|
|
145
145
|
- lib/oh_my_embed.rb
|
146
146
|
- lib/oh_my_embed/crawler.rb
|
147
147
|
- lib/oh_my_embed/provider.rb
|
148
|
+
- lib/oh_my_embed/providers/dailymotion.rb
|
149
|
+
- lib/oh_my_embed/providers/deviant_art.rb
|
148
150
|
- lib/oh_my_embed/providers/facebook_post.rb
|
149
151
|
- lib/oh_my_embed/providers/facebook_video.rb
|
150
152
|
- lib/oh_my_embed/providers/flickr.rb
|
@@ -154,10 +156,14 @@ files:
|
|
154
156
|
- lib/oh_my_embed/providers/soundcloud.rb
|
155
157
|
- lib/oh_my_embed/providers/spotify.rb
|
156
158
|
- lib/oh_my_embed/providers/twitter.rb
|
159
|
+
- lib/oh_my_embed/providers/viddler.rb
|
160
|
+
- lib/oh_my_embed/providers/vimeo.rb
|
157
161
|
- lib/oh_my_embed/providers/youtube.rb
|
158
162
|
- lib/oh_my_embed/response.rb
|
159
163
|
- lib/oh_my_embed/version.rb
|
160
164
|
- oh-my-embed.gemspec
|
165
|
+
- spec/fixtures/vcr_cassettes/dailymotion.yml
|
166
|
+
- spec/fixtures/vcr_cassettes/deviantart.yml
|
161
167
|
- spec/fixtures/vcr_cassettes/facebook_posts.yml
|
162
168
|
- spec/fixtures/vcr_cassettes/facebook_videos.yml
|
163
169
|
- spec/fixtures/vcr_cassettes/flickr.yml
|
@@ -167,9 +173,13 @@ files:
|
|
167
173
|
- spec/fixtures/vcr_cassettes/soundcloud.yml
|
168
174
|
- spec/fixtures/vcr_cassettes/spotify.yml
|
169
175
|
- spec/fixtures/vcr_cassettes/twitter.yml
|
176
|
+
- spec/fixtures/vcr_cassettes/viddler.yml
|
177
|
+
- spec/fixtures/vcr_cassettes/vimeo.yml
|
170
178
|
- spec/fixtures/vcr_cassettes/youtube.yml
|
171
179
|
- spec/oh_my_embed/crawler_spec.rb
|
172
180
|
- spec/oh_my_embed/provider_spec.rb
|
181
|
+
- spec/oh_my_embed/providers/dailymotion_spec.rb
|
182
|
+
- spec/oh_my_embed/providers/deviant_art_spec.rb
|
173
183
|
- spec/oh_my_embed/providers/facebook_post_spec.rb
|
174
184
|
- spec/oh_my_embed/providers/facebook_video_spec.rb
|
175
185
|
- spec/oh_my_embed/providers/flickr_spec.rb
|
@@ -179,6 +189,8 @@ files:
|
|
179
189
|
- spec/oh_my_embed/providers/soundcloud_spec.rb
|
180
190
|
- spec/oh_my_embed/providers/spotify_spec.rb
|
181
191
|
- spec/oh_my_embed/providers/twitter_spec.rb
|
192
|
+
- spec/oh_my_embed/providers/viddler_spec.rb
|
193
|
+
- spec/oh_my_embed/providers/vimeo_spec.rb
|
182
194
|
- spec/oh_my_embed/providers/youtube_spec.rb
|
183
195
|
- spec/oh_my_embed/response_spec.rb
|
184
196
|
- spec/oh_my_embed_spec.rb
|
@@ -208,6 +220,8 @@ signing_key:
|
|
208
220
|
specification_version: 4
|
209
221
|
summary: Simple gem to interact with oauth providers
|
210
222
|
test_files:
|
223
|
+
- spec/fixtures/vcr_cassettes/dailymotion.yml
|
224
|
+
- spec/fixtures/vcr_cassettes/deviantart.yml
|
211
225
|
- spec/fixtures/vcr_cassettes/facebook_posts.yml
|
212
226
|
- spec/fixtures/vcr_cassettes/facebook_videos.yml
|
213
227
|
- spec/fixtures/vcr_cassettes/flickr.yml
|
@@ -217,9 +231,13 @@ test_files:
|
|
217
231
|
- spec/fixtures/vcr_cassettes/soundcloud.yml
|
218
232
|
- spec/fixtures/vcr_cassettes/spotify.yml
|
219
233
|
- spec/fixtures/vcr_cassettes/twitter.yml
|
234
|
+
- spec/fixtures/vcr_cassettes/viddler.yml
|
235
|
+
- spec/fixtures/vcr_cassettes/vimeo.yml
|
220
236
|
- spec/fixtures/vcr_cassettes/youtube.yml
|
221
237
|
- spec/oh_my_embed/crawler_spec.rb
|
222
238
|
- spec/oh_my_embed/provider_spec.rb
|
239
|
+
- spec/oh_my_embed/providers/dailymotion_spec.rb
|
240
|
+
- spec/oh_my_embed/providers/deviant_art_spec.rb
|
223
241
|
- spec/oh_my_embed/providers/facebook_post_spec.rb
|
224
242
|
- spec/oh_my_embed/providers/facebook_video_spec.rb
|
225
243
|
- spec/oh_my_embed/providers/flickr_spec.rb
|
@@ -229,6 +247,8 @@ test_files:
|
|
229
247
|
- spec/oh_my_embed/providers/soundcloud_spec.rb
|
230
248
|
- spec/oh_my_embed/providers/spotify_spec.rb
|
231
249
|
- spec/oh_my_embed/providers/twitter_spec.rb
|
250
|
+
- spec/oh_my_embed/providers/viddler_spec.rb
|
251
|
+
- spec/oh_my_embed/providers/vimeo_spec.rb
|
232
252
|
- spec/oh_my_embed/providers/youtube_spec.rb
|
233
253
|
- spec/oh_my_embed/response_spec.rb
|
234
254
|
- spec/oh_my_embed_spec.rb
|