ruby-oembed 0.10.0 → 0.13.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 +5 -5
- data/.coveralls.yml +1 -0
- data/.gitignore +11 -2
- data/.travis.yml +3 -6
- data/CHANGELOG.rdoc +35 -0
- data/Gemfile +12 -10
- data/README.md +118 -0
- data/Rakefile +2 -0
- data/lib/oembed/providers.rb +56 -5
- data/lib/oembed/providers/embedly_urls.yml +1000 -133
- data/lib/oembed/providers/noembed_urls.yml +321 -0
- data/lib/oembed/version.rb +3 -3
- data/lib/tasks/oembed.rake +24 -23
- data/ruby-oembed.gemspec +5 -33
- data/spec/cassettes/OEmbed_Provider.yml +882 -119
- data/spec/cassettes/OEmbed_ProviderDiscovery.yml +26007 -35598
- data/spec/cassettes/OEmbed_Providers_Slideshare.yml +1433 -0
- data/spec/cassettes/OEmbed_Providers_Twitter.yml +612 -0
- data/spec/provider_discovery_spec.rb +3 -15
- data/spec/provider_spec.rb +9 -23
- data/spec/providers/slideshare_spec.rb +42 -0
- data/spec/providers/twitter_spec.rb +44 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/spec_helper_examples.yml +6 -16
- data/spec/support/shared_examples_for_providers.rb +39 -0
- metadata +20 -80
- data/README.rdoc +0 -87
@@ -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/.*
|
data/lib/oembed/version.rb
CHANGED
data/lib/tasks/oembed.rake
CHANGED
@@ -4,43 +4,44 @@ begin
|
|
4
4
|
require 'open-uri'
|
5
5
|
|
6
6
|
namespace :oembed do
|
7
|
-
desc "Update the
|
8
|
-
task :
|
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("
|
11
|
-
yaml_path = File.join(File.dirname(__FILE__), "../oembed/providers/
|
12
|
-
|
10
|
+
json_uri = URI.parse("https://noembed.com/providers")
|
11
|
+
yaml_path = File.join(File.dirname(__FILE__), "../oembed/providers/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['
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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/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
|
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
|
-
|
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
|
data/ruby-oembed.gemspec
CHANGED
@@ -11,10 +11,10 @@ Gem::Specification.new do |s|
|
|
11
11
|
|
12
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
13
|
s.authors = ["Magnus Holm", "Alex Kessinger", "Aris Bartee", "Marcos Wright Kuhns"]
|
14
|
-
s.date = "
|
14
|
+
s.date = Time.now.strftime("%F")
|
15
15
|
s.description = "An oEmbed consumer library written in Ruby, letting you easily get embeddable HTML representations of supported web pages, based on their URLs. See http://oembed.com for more information about the protocol."
|
16
|
-
s.email = "
|
17
|
-
s.homepage = "
|
16
|
+
s.email = "webmaster@wrightkuhns.com"
|
17
|
+
s.homepage = "https://github.com/ruby-oembed/ruby-oembed"
|
18
18
|
s.licenses = ["MIT"]
|
19
19
|
|
20
20
|
s.files = `git ls-files`.split("\n")
|
@@ -27,34 +27,6 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.rubygems_version = "1.8.19"
|
28
28
|
s.summary = "oEmbed for Ruby"
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
34
|
-
s.add_development_dependency(%q<rake>, [">= 0"])
|
35
|
-
s.add_development_dependency(%q<json>, [">= 0"])
|
36
|
-
s.add_development_dependency(%q<xml-simple>, [">= 0"])
|
37
|
-
s.add_development_dependency(%q<nokogiri>, [">= 0"])
|
38
|
-
s.add_development_dependency(%q<rspec>, ["~> 3.0"])
|
39
|
-
s.add_development_dependency(%q<vcr>, ["~> 1.0"])
|
40
|
-
s.add_development_dependency(%q<fakeweb>, [">= 0"])
|
41
|
-
else
|
42
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
43
|
-
s.add_dependency(%q<json>, [">= 0"])
|
44
|
-
s.add_dependency(%q<xml-simple>, [">= 0"])
|
45
|
-
s.add_dependency(%q<nokogiri>, [">= 0"])
|
46
|
-
s.add_dependency(%q<rspec>, ["~> 3.0"])
|
47
|
-
s.add_dependency(%q<vcr>, ["~> 1.0"])
|
48
|
-
s.add_dependency(%q<fakeweb>, [">= 0"])
|
49
|
-
end
|
50
|
-
else
|
51
|
-
s.add_dependency(%q<rake>, [">= 0"])
|
52
|
-
s.add_dependency(%q<json>, [">= 0"])
|
53
|
-
s.add_dependency(%q<xml-simple>, [">= 0"])
|
54
|
-
s.add_dependency(%q<nokogiri>, [">= 0"])
|
55
|
-
s.add_dependency(%q<rspec>, ["~> 3.0"])
|
56
|
-
s.add_dependency(%q<vcr>, ["~> 1.0"])
|
57
|
-
s.add_dependency(%q<fakeweb>, [">= 0"])
|
58
|
-
end
|
30
|
+
s.add_development_dependency 'xml-simple', '>= 0'
|
31
|
+
s.add_development_dependency 'nokogiri', '>= 0'
|
59
32
|
end
|
60
|
-
|