Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Commit

Permalink
Add support of Gyazo (#124)
Browse files Browse the repository at this point in the history
* add support of Gyazo

[Gyazo](https://gyazo.com/en) is a screenshot sharing service.

* add `gyazo.js`
  • Loading branch information
shuuji3 authored and eramdam committed Mar 9, 2017
1 parent 0c61c3a commit a2d169e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/js/util/providers/gyazo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default function ($) {
return {
name: 'Gyazo',
setting: 'gyazo',
re: /gyazo.com/,
default: true,
callback: url => {
return fetch($.getSafeURL(`${$.getEnpointFor('gyazo')}${url}`))
.then($.statusAndJson)
.then(data => {
const obj = {
type: 'image',
thumbnail_url: $.getSafeURL(data.url),
url: $.getSafeURL(data.url),
};

return obj;
});
},
};
}
1 change: 1 addition & 0 deletions src/js/util/providers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ export { default as twipple } from './twipple';
export { default as pixiv } from './pixiv';
export { default as tinami } from './tinami';
export { default as nicoseiga } from './nicoseiga';
export { default as gyazo } from './gyazo';
2 changes: 2 additions & 0 deletions src/js/util/thumbnails.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const endpoints = {
pixiv: 'http://embed.pixiv.net/embed_json.php?callback=callback&size=medium&id=',
tinami: 'https://www.tinami.com/api/content/info?',
nicoseiga: 'http://ext.seiga.nicovideo.jp/thumb/',
gyazo: 'https://api.gyazo.com/api/oembed?url=',
};

let providersSettings;
Expand Down Expand Up @@ -126,6 +127,7 @@ const schemeWhitelist = [
Providers.dribbble(util),
Providers.droplr(util),
Providers.flickr(util),
Providers.gyazo(util),
Providers.gfycat(util),
Providers.giphy(util),
Providers.imgur(util),
Expand Down

0 comments on commit a2d169e

Please sign in to comment.