ruby-oembed 0.10.1 → 0.14.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.
@@ -0,0 +1,321 @@
1
+ ---
2
+ - http://(?:www\.)?theverge\.com/\d{4}/\d{1,2}/\d{1,2}/\d+/[^/]+/?$
3
+ - http://(?:www\.)?twitpic\.com/([^/]+)
4
+ - http://(?:www\.)?xkcd\.com/\d+/?
5
+ - http://amzn\.com/([^/]+)
6
+ - http://arstechnica\.com/[^/]+/\d+/\d+/[^/]+/?$
7
+ - http://bash\.org/\?(\d+)
8
+ - http://boingboing\.net/\d{4}/\d{2}/\d{2}/[^/]+\.html
9
+ - http://cl\.ly/(?:image/)?[0-9a-zA-Z]+/?$
10
+ - http://gfycat\.com/([a-zA-Z]+)
11
+ - http://lockerz\.com/[sd]/\d+
12
+ - http://picplz\.com/user/[^/]+/pic/[^/]+
13
+ - http://qik\.com/video/.*
14
+ - http://skit.ch/[^/]+
15
+ - http://tl\.gd/[^/]+
16
+ - http://trailers\.apple\.com/trailers/[^/]+/[^/]+
17
+ - http://www.traileraddict.com/trailer/[^/]+/trailer
18
+ - http://www\.amazon\.com/(?:.+/)?[gd]p/(?:product/)?(?:tags-on-product/)?([a-zA-Z0-9]+)
19
+ - http://www\.asciiartfarts\.com/[0-9]+\.html
20
+ - http://www\.clickhole\.com/[^/]+/[^/]?
21
+ - http://www\.duffelblog\.com/\d{4}/\d{1,2}/[^/]+/?$
22
+ - http://www\.monoprice\.com/products/product\.asp\?.*p_id=\d+
23
+ - http://www\.theonion\.com/articles?/[^/]+/?
24
+ - http://www\.twitlonger\.com/show/[a-zA-Z0-9]+
25
+ - http://www\.urbandictionary\.com/define\.php\?term=.+
26
+ - https://tube.switch.ch/videos/([a-z0-9]+)
27
+ - https?://(?:[^\.]+\.)?(?:youtu\.be|youtube\.com/embed)/([a-zA-Z0-9_-]+)
28
+ - https?://(?:[^\.]+\.)?youtube\.com/watch/?\?(?:.+&)?v=([^&]+)
29
+ - https?://(?:www.)?skitch.com/([^/]+)/[^/]+/.+
30
+ - https?://(?:www\.)?avclub\.com/article/[^/]+/?$
31
+ - https?://(?:www\.)?vice\.com/[^/]+/?
32
+ - https?://(?:www\.)?vimeo\.com/.+
33
+ - https?://(?:www\.)?wired\.com/([^/]+/)?\d+/\d+/[^/]+/?$
34
+ - https?://(?:www\.)spreaker\.com/.+
35
+ - https?://(?:www|mobile\.)?twitter\.com/(?:#!/)?([^/]+)/status(?:es)?/(\d+)
36
+ - https?://.*\.channel\.geographs\.org/.*
37
+ - https?://.*\.deviantart\.com/.*#/d.*
38
+ - https?://.*\.deviantart\.com/art/.*
39
+ - https?://.*\.didacte\.com/a/course/.*
40
+ - https?://.*\.docdroid\.net/.*
41
+ - https?://.*\.docdroid\.net/.*
42
+ - https?://.*\.flat\.io/score/.*
43
+ - https?://.*\.flickr\.com/photos/.*
44
+ - https?://.*\.geograph\.co\.uk/.*
45
+ - https?://.*\.geograph\.ie/.*
46
+ - https?://.*\.geograph\.org\.gg/.*
47
+ - https?://.*\.geograph\.org\.je/.*
48
+ - https?://.*\.geograph\.org\.uk/.*
49
+ - https?://.*\.inphood\.com/.*
50
+ - https?://.*\.nanoo\.pro/link/.*
51
+ - https?://.*\.nanoo\.pro/link/.*
52
+ - https?://.*\.nanoo\.tv/link/.*
53
+ - https?://.*\.nanoo\.tv/link/.*
54
+ - https?://.*\.nfb\.ca/film/.*
55
+ - https?://.*\.nytimes\.com/.*
56
+ - https?://.*\.polldaddy\.com/poll/.*
57
+ - https?://.*\.polldaddy\.com/ratings/.*
58
+ - https?://.*\.polldaddy\.com/s/.*
59
+ - https?://.*\.screen9\.tv/.*
60
+ - https?://.*\.silk\.co/explore/.*
61
+ - https?://.*\.silk\.co/explore/.*
62
+ - https?://.*\.silk\.co/s/embed/.*
63
+ - https?://.*\.silk\.co/s/embed/.*
64
+ - https?://.*\.smugmug\.com/.*
65
+ - https?://.*\.spreaker\.com/.*
66
+ - https?://.*\.spreaker\.com/.*
67
+ - https?://.*\.uol\.com\.br/video/.*
68
+ - https?://.*\.uol\.com\.br/view/.*
69
+ - https?://.*\.ustream\.com/.*
70
+ - https?://.*\.ustream\.tv/.*
71
+ - https?://.*\.wikimedia\.org/.*_geograph\.org\.uk_.*
72
+ - https?://.*\.wiredrive\.com/.*
73
+ - https?://.*\.wizer\.me/learn/.*
74
+ - https?://.*\.wizer\.me/learn/.*
75
+ - https?://.*\.wizer\.me/preview/.*
76
+ - https?://.*\.wizer\.me/preview/.*
77
+ - https?://.*\.yfrog\.com/.*
78
+ - https?://alpha\.app\.net/.*/post/.*
79
+ - https?://animatron\.com/project/.*
80
+ - https?://animoto\.com/play/.*
81
+ - https?://app\.cyranosystems\.com/msg/.*
82
+ - https?://app\.sellwithport\.com/#/buyer/.*
83
+ - https?://audiosnaps\.com/k/.*
84
+ - https?://beta\.modelo\.io/embedded/.*
85
+ - https?://blackfire\.io/profiles/.*/graph
86
+ - https?://blackfire\.io/profiles/compare/.*/graph
87
+ - https?://buttondown\.email/.*
88
+ - https?://cacoo\.com/diagrams/.*
89
+ - https?://carbonhealth\.com/practice/.*
90
+ - https?://channel-islands\.geograph\.org/.*
91
+ - https?://channel-islands\.geographs\.org/.*
92
+ - https?://chirb\.it/.*
93
+ - https?://clips\.twitch\.tv/.*
94
+ - https?://clips\.twitch\.tv/.*
95
+ - https?://clyp\.it/.*
96
+ - https?://clyp\.it/playlist/.*
97
+ - https?://codepen\.io/.*
98
+ - https?://codepen\.io/.*
99
+ - https?://codepoints\.net/.*
100
+ - https?://codepoints\.net/.*
101
+ - https?://codesandbox\.io/embed/.*
102
+ - https?://codesandbox\.io/s/.*
103
+ - https?://commaful\.com/play/.*
104
+ - https?://console\.screen9\.com/.*
105
+ - https?://content\.streamonecloud\.net/embed/.*
106
+ - https?://coub\.com/embed/.*
107
+ - https?://coub\.com/view/.*
108
+ - https?://crowdranking\.com/.*/.*
109
+ - https?://db\.tt/[a-zA-Z0-9]+
110
+ - https?://de\.slideshare\.net/.*/.*
111
+ - https?://docdro\.id/.*
112
+ - https?://docdro\.id/.*
113
+ - https?://docs\.com/.*
114
+ - https?://dotsub\.com/view/.*
115
+ - https?://edocr\.com/docs/.*
116
+ - https?://egliseinfo\.catholique\.fr/.*
117
+ - https?://embedarticles\.com/.*
118
+ - https?://es\.slideshare\.net/.*/.*
119
+ - https?://eyrie\.io/board/.*
120
+ - https?://eyrie\.io/sparkfun/.*
121
+ - https?://fav\.me/.*
122
+ - https?://fiso\.foxsports\.com\.au/isomorphic-widget/.*
123
+ - https?://fiso\.foxsports\.com\.au/isomorphic-widget/.*
124
+ - https?://flat\.io/score/.*
125
+ - https?://flic\.kr/p/.*
126
+ - https?://fr\.slideshare\.net/.*/.*
127
+ - https?://framebuzz\.com/v/.*
128
+ - https?://framebuzz\.com/v/.*
129
+ - https?://geo-en\.hlipp\.de/.*
130
+ - https?://geo\.hlipp\.de/.*
131
+ - https?://germany\.geograph\.org/.*
132
+ - https?://gfycat\.com/.*
133
+ - https?://gfycat\.com/.*
134
+ - https?://giphy\.com/gifs/.*
135
+ - https?://gph\.is/.*
136
+ - https?://gty\.im/.*
137
+ - https?://gyazo\.com/.*
138
+ - https?://huffduffer\.com/.*/.*
139
+ - https?://ifttt\.com/recipes/.*
140
+ - https?://img\.catbo\.at/.*
141
+ - https?://imgur\.com/(?:[^\/]+/)?[0-9a-zA-Z]+$
142
+ - https?://infogr\.am/.*
143
+ - https?://instagr\.am/p/.*
144
+ - https?://instagr\.am/p/.*
145
+ - https?://instagram\.com/p/.*
146
+ - https?://instagram\.com/p/.*
147
+ - https?://jdr\.knacki\.info/meuh/.*
148
+ - https?://jdr\.knacki\.info/meuh/.*
149
+ - https?://kit\.com/.*/.*
150
+ - https?://kit\.com/.*/.*
151
+ - https?://learningapps\.org/.*
152
+ - https?://live\.amcharts\.com/.*
153
+ - https?://mathembed\.com/latex\?inputText=.*
154
+ - https?://mathembed\.com/latex\?inputText=.*
155
+ - https?://me\.me/i/.*
156
+ - https?://media\.giphy\.com/media/.*/giphy\.gif
157
+ - https?://meetu\.ps/.*
158
+ - https?://meetup\.com/.*
159
+ - https?://mix\.office\.com/embed/.*
160
+ - https?://mix\.office\.com/watch/.*
161
+ - https?://moby\.to/.*
162
+ - https?://muki\.io/(embed/)?(.+)
163
+ - https?://mybeweeg\.com/w/.*
164
+ - https?://nanoo\.pro/link/.*
165
+ - https?://nanoo\.pro/link/.*
166
+ - https?://nanoo\.tv/link/.*
167
+ - https?://nanoo\.tv/link/.*
168
+ - https?://news.vice\.com/[^/]+/?
169
+ - https?://nytimes\.com/.*
170
+ - https?://odds\.com\.au/.*
171
+ - https?://official\.fm/playlists/.*
172
+ - https?://official\.fm/tracks/.*
173
+ - https?://on\.aol\.com/video/.*
174
+ - https?://onsizzle\.com/i/.*
175
+ - https?://orbitvu\.co/001/.*/1/2/orbittour/.*/view
176
+ - https?://orbitvu\.co/001/.*/1/2/orbittour/.*/view
177
+ - https?://orbitvu\.co/001/.*/2/orbittour/.*/view
178
+ - https?://orbitvu\.co/001/.*/2/orbittour/.*/view
179
+ - https?://orbitvu\.co/001/.*/ov3601/.*/view
180
+ - https?://orbitvu\.co/001/.*/ov3601/.*/view
181
+ - https?://orbitvu\.co/001/.*/ov3601/view
182
+ - https?://orbitvu\.co/001/.*/ov3601/view
183
+ - https?://orbitvu\.co/001/.*/ov3602/.*/view
184
+ - https?://orbitvu\.co/001/.*/ov3602/.*/view
185
+ - https?://pastery\.net/.*
186
+ - https?://pastery\.net/.*
187
+ - https?://path\.com/p/([0-9a-zA-Z]+)$
188
+ - https?://photos\.app\.net/.*/.*
189
+ - https?://play\.soundsgood\.co/playlist/.*
190
+ - https?://player\.indacolive\.com/player/jwp/clients/.*
191
+ - https?://player\.ubideo\.com/.*
192
+ - https?://player\.vimeo\.com/video/.*
193
+ - https?://portfolium\.com/entry/.*
194
+ - https?://pt\.slideshare\.net/.*/.*
195
+ - https?://public\.chartblocks\.com/c/.*
196
+ - https?://punters\.com\.au/.*
197
+ - https?://rapidengage\.com/s/.*
198
+ - https?://reddit\.com/r/.*/comments/.*/.*
199
+ - https?://reports\.zoho\.com/ZDBDataSheetView\.cc\?OBJID=1432535000000003002&STANDALONE=true&INTERVAL=120&DATATYPESYMBOL=false&REMTOOLBAR=false&SEARCHBOX=true&INCLUDETITLE=true&INCLUDEDESC=true&SHOWHIDEOPT=true
200
+ - https?://repubhub\.icopyright\.net/freePost\.act\?.*
201
+ - https?://roomshare\.jp/en/post/.*
202
+ - https?://roomshare\.jp/post/.*
203
+ - https?://rwire\.com/.*
204
+ - https?://scribblemaps\.com/maps/view/.*
205
+ - https?://scribblemaps\.com/maps/view/.*
206
+ - https?://shoud\.io/.*
207
+ - https?://shoudio\.com/.*
208
+ - https?://showtheway\.io/to/.*
209
+ - https?://sketchfab\.com/.*/folders/.*
210
+ - https?://sketchfab\.com/models/.*
211
+ - https?://sketchfab\.com/models/.*
212
+ - https?://soundcloud.com/.*/.*
213
+ - https?://soundcloud\.com/.*
214
+ - https?://soundsgood\.co/playlist/.*
215
+ - https?://speakerdeck\.com/.*/.*
216
+ - https?://speakerdeck\.com/.*/.*
217
+ - https?://sta\.sh/.*
218
+ - https?://staging\.cyranosystems\.com/msg/.*
219
+ - https?://store\.pixdor\.com/map/.*/show
220
+ - https?://store\.pixdor\.com/place-marker-widget/.*/show
221
+ - https?://streamable\.com/.*
222
+ - https?://streamable\.com/.*
223
+ - https?://sway\.com/.*
224
+ - https?://ted\.com/talks/.*
225
+ - https?://theysaidso\.com/image/.*
226
+ - https?://twitch\.tv/.*
227
+ - https?://twitch\.tv/.*
228
+ - https?://twitter\.com/.*/status/.*
229
+ - https?://utposts\.com/products/.*
230
+ - https?://utposts\.com/products/.*
231
+ - https?://uttles\.com/uttle/.*
232
+ - https?://v\.nldg\.me/.+
233
+ - https?://veer\.tv/videos/.*
234
+ - https?://veervr\.tv/videos/.*
235
+ - https?://videos\.sapo\.pt/.*
236
+ - https?://vidl\.it/.*
237
+ - https?://vimeo\.com/.*
238
+ - https?://vimeo\.com/album/.*/video/.*
239
+ - https?://vimeo\.com/channels/.*/.*
240
+ - https?://vimeo\.com/groups/.*/videos/.*
241
+ - https?://vimeo\.com/ondemand/.*/.*
242
+ - https?://vine.co/v/[a-zA-Z0-9]+
243
+ - https?://vlipsy\.com/.*
244
+ - https?://www\.(dropbox\.com/s/.+\.(?:jpg|png|gif))
245
+ - https?://www\.23hq\.com/.*/photo/.*
246
+ - https?://www\.animatron\.com/project/.*
247
+ - https?://www\.audiomack\.com/album/.*
248
+ - https?://www\.audiomack\.com/playlist/.*
249
+ - https?://www\.audiomack\.com/song/.*
250
+ - https?://www\.circuitlab\.com/circuit/.*
251
+ - https?://www\.clipland\.com/v/.*
252
+ - https?://www\.clipland\.com/v/.*
253
+ - https?://www\.codepoints\.net/.*
254
+ - https?://www\.codepoints\.net/.*
255
+ - https?://www\.collegehumor\.com/video/.*
256
+ - https?://www\.dailymile\.com/people/.*/entries/.*
257
+ - https?://www\.dailymotion\.com/video/.*
258
+ - https?://www\.dipity\.com/.*/.*/
259
+ - https?://www\.docs\.com/.*
260
+ - https?://www\.facebook\.com/.*/videos/.*
261
+ - https?://www\.facebook\.com/video\.php
262
+ - https?://www\.funnyordie\.com/videos/.*
263
+ - https?://www\.gfycat\.com/.*
264
+ - https?://www\.gfycat\.com/.*
265
+ - https?://www\.giantbomb\.com/videos/[^/]+/\d+-\d+/?
266
+ - https?://www\.globalgiving\.org/((micro)?projects|funds)/.*
267
+ - https?://www\.hulu\.com/watch/.*
268
+ - https?://www\.ifixit\.com/Guide/View/.*
269
+ - https?://www\.inoreader\.com/oembed/
270
+ - https?://www\.instagr\.am/p/.*
271
+ - https?://www\.instagr\.am/p/.*
272
+ - https?://www\.instagram\.com/p/.*
273
+ - https?://www\.instagram\.com/p/.*
274
+ - https?://www\.isnare\.com/.*
275
+ - https?://www\.kickstarter\.com/projects/.*
276
+ - https?://www\.kidoju\.com/en/x/.*/.*
277
+ - https?://www\.kidoju\.com/fr/x/.*/.*
278
+ - https?://www\.kitchenbowl\.com/recipe/.*
279
+ - https?://www\.mixcloud\.com/.*/.*/
280
+ - https?://www\.mobypicture\.com/user/.*/view/.*
281
+ - https?://www\.nooledge\.com/\!/Vid/.+
282
+ - https?://www\.nytimes\.com/svc/oembed
283
+ - https?://www\.odds\.com\.au/.*
284
+ - https?://www\.oumy\.com/v/.*
285
+ - https?://www\.pastery\.net/.*
286
+ - https?://www\.pastery\.net/.*
287
+ - https?://www\.punters\.com\.au/.*
288
+ - https?://www\.quiz\.biz/quizz-.*\.html
289
+ - https?://www\.quizz\.biz/quizz-.*\.html
290
+ - https?://www\.reverbnation\.com/.*
291
+ - https?://www\.reverbnation\.com/.*/songs/.*
292
+ - https?://www\.screenr\.com/.*/
293
+ - https?://www\.scribblemaps\.com/maps/view/.*
294
+ - https?://www\.scribblemaps\.com/maps/view/.*
295
+ - https?://www\.scribd\.com/doc/.*
296
+ - https?://www\.shortnote\.jp/view/notes/.*
297
+ - https?://www\.slideshare\.net/.*/.*
298
+ - https?://www\.socialexplorer\.com/.*/edit
299
+ - https?://www\.socialexplorer\.com/.*/embed
300
+ - https?://www\.socialexplorer\.com/.*/explore
301
+ - https?://www\.socialexplorer\.com/.*/view
302
+ - https?://www\.sutori\.com/story/.*
303
+ - https?://www\.sway\.com/.*
304
+ - https?://www\.tickcounter\.com/countdown/.*
305
+ - https?://www\.tickcounter\.com/countdown/.*
306
+ - https?://www\.tickcounter\.com/countup/.*
307
+ - https?://www\.tickcounter\.com/countup/.*
308
+ - https?://www\.tickcounter\.com/ticker/.*
309
+ - https?://www\.tickcounter\.com/ticker/.*
310
+ - https?://www\.tickcounter\.com/worldclock/.*
311
+ - https?://www\.tickcounter\.com/worldclock/.*
312
+ - https?://www\.topy\.se/image/.*
313
+ - https?://www\.twitch\.tv/.*
314
+ - https?://www\.twitch\.tv/.*
315
+ - https?://www\.utposts\.com/products/.*
316
+ - https?://www\.utposts\.com/products/.*
317
+ - https?://www\.vevo\.com/.*
318
+ - https?://www\.vevo\.com/.*
319
+ - https?://www\.videojug\.com/film/.*
320
+ - https?://www\.videojug\.com/interview/.*
321
+ - https?://yfrog\.us/.*
@@ -0,0 +1,25 @@
1
+ module OEmbed
2
+ class Providers
3
+ # Provider for Facebook posts
4
+ class FacebookPost < OEmbed::Provider
5
+ def initialize(access_token:)
6
+ super("https://graph.facebook.com/v8.0/oembed_post?access_token=#{access_token}", :json)
7
+ register_urls!
8
+ end
9
+
10
+ private
11
+
12
+ def register_urls!
13
+ ['https://www.facebook.com/*/posts/*',
14
+ 'https://www.facebook.com/*/activity/*',
15
+ 'https://www.facebook.com/photo*',
16
+ 'https://www.facebook.com/photos*',
17
+ 'https://www.facebook.com/*/photos*',
18
+ 'https://www.facebook.com/permalink*',
19
+ 'https://www.facebook.com/media*',
20
+ 'https://www.facebook.com/questions*',
21
+ 'https://www.facebook.com/notes*'].each { |u| self << u }
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,18 @@
1
+ module OEmbed
2
+ class Providers
3
+ # Provider for Facebook videos
4
+ class FacebookVideo < OEmbed::Provider
5
+ def initialize(access_token:)
6
+ super("https://graph.facebook.com/v8.0/oembed_video?access_token=#{access_token}", :json)
7
+ register_urls!
8
+ end
9
+
10
+ private
11
+
12
+ def register_urls!
13
+ ['https://www.facebook.com/*/videos/*',
14
+ 'https://www.facebook.com/video*'].each { |u| self << u }
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,28 @@
1
+ module OEmbed
2
+ class Providers
3
+ # Provider for instagram.com
4
+ class Instagram < OEmbed::Provider
5
+ def initialize(access_token:)
6
+ super("https://graph.facebook.com/v8.0/instagram_oembed?access_token=#{access_token}", :json)
7
+ register_urls!
8
+ end
9
+
10
+ private
11
+
12
+ def register_urls!
13
+ ["http://instagr.am/p/*",
14
+ "http://instagram.com/p/*",
15
+ "http://www.instagram.com/p/*",
16
+ "https://instagr.am/p/*",
17
+ "https://instagram.com/p/*",
18
+ "https://www.instagram.com/p/*",
19
+ "http://instagr.am/tv/*",
20
+ "http://instagram.com/tv/*",
21
+ "http://www.instagram.com/tv/*",
22
+ "https://instagr.am/tv/*",
23
+ "https://instagram.com/tv/*",
24
+ "https://www.instagram.com/tv/*"].each { |u| self << u }
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,8 +1,8 @@
1
1
  module OEmbed
2
2
  class Version
3
3
  MAJOR = 0
4
- MINOR = 10
5
- PATCH = 1
4
+ MINOR = 14
5
+ PATCH = 0
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
 
8
8
  class << self
@@ -4,43 +4,44 @@ begin
4
4
  require 'open-uri'
5
5
 
6
6
  namespace :oembed do
7
- desc "Update the embedly_urls.yml file using the services api."
8
- task :update_embedly do
7
+ desc "Update the noembed_urls.yml file using the services api."
8
+ task :update_noembed do
9
9
  # Details at http://api.embed.ly/docs/service
10
- json_uri = URI.parse("http://api.embed.ly/1/services")
11
- yaml_path = File.join(File.dirname(__FILE__), "../oembed/providers/embedly_urls.yml")
12
-
10
+ json_uri = URI.parse("https://noembed.com/providers")
11
+ yaml_path = File.join(File.dirname(__FILE__), "../oembed/providers/aggregators/noembed_urls.yml")
12
+
13
13
  services = JSON.parse(json_uri.read)
14
-
14
+
15
15
  url_regexps = []
16
16
  services.each do |service|
17
- url_regexps += service['regex'].map{|r| r.strip }
17
+ url_regexps += service['patterns'].map{|r| r.strip }
18
18
  end
19
19
  url_regexps.sort!
20
-
20
+
21
21
  YAML.dump(url_regexps, File.open(yaml_path, 'w'))
22
22
  end
23
-
24
- # Note: At the moment the list of enpoints in the oohembed-provided JSON file
25
- # do NOT match the full listing on their website. Until we sort that out, we'll
26
- # continue to use the manually entered list of oohembed URLs
27
- desc "Update the list of URLs supported by oohembed via their API"
28
- task :update_oohembed do
29
- # Details in the Q & A section of http://oohembed.com/
30
- json_uri = URI.parse("http://oohembed.com/static/endpoints.json")
31
- yaml_path = File.join(File.dirname(__FILE__), "../oembed/providers/oohembed_urls.yml")
32
-
23
+
24
+ desc "Update the embedly_urls.yml file using the services api."
25
+ task :update_embedly do
26
+ # Details at http://api.embed.ly/docs/service
27
+ json_uri = URI.parse("http://api.embed.ly/1/services")
28
+ yaml_path = File.join(File.dirname(__FILE__), "../oembed/providers/aggregators/embedly_urls.yml")
29
+
33
30
  services = JSON.parse(json_uri.read)
34
-
31
+
35
32
  url_regexps = []
36
33
  services.each do |service|
37
- url_regexps << service['url']
34
+ url_regexps += service['regex'].map{|r| r.strip }
38
35
  end
39
36
  url_regexps.sort!
40
-
37
+
41
38
  YAML.dump(url_regexps, File.open(yaml_path, 'w'))
42
39
  end
43
- end
40
+
41
+ task :update_oohembed do
42
+ raise "Unfortunately the oohembed has discontinued."
43
+ end
44
+ end
44
45
  rescue LoadError
45
46
  puts "The oembed rake tasks require JSON. Install it with: gem install json"
46
- end
47
+ end