mastodon_import_emoji 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
mastodon_import_emoji 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
mastodon_import_emoji 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 AGPL-3.0 License
开发语言 JavaScript
操作系统 跨平台
软件类型 开源软件
开源组织
地区 不详
投 递 者 首席测试
适用人群 未知
收录时间 2021-12-02

软件简介

Mastodon custom emoji importer

Usage

Run from inside your Mastodon ("live") directory: bundle exec rails runner import_emoji.rb [options] [command]

Options

--prefix [prefix] Prefix shortcodes of all imported emoji with a string

--dry-run Don't actually save anything to the database

--match [regexp] Only import emoji with shortcodes that match the given regular expression

--lower Convert all shortcodes to lowercase

--square Add padding to images to ensure a 1:1 aspect ratio

--minsize Images smaller than this size (format WxH) are padded to be this size

--hide Hide imported emoji from the emoji picker

--no-overwriting By default, the script will remove any custom emoji with the same shortcode as a new one before adding the new one. This disables that functionality, and will not import any emoji with conflicting shortcodes.

--convert-gif Convert animated GIF to animated PNG. Requires gif2apng to be installed.

Commands

steamgame [appid|title] Import all emotes from a Steam game, either given its numeric AppID, or the (start of) the game name. Requires the nokogiri Ruby gem.

steamprofile [steam64id] Import all Steam emotes available to a user given their profile ID (find that here).

twitchchannel [channel] Import the emotes available to subscribers of the given Twitch.tv channel, or available to all if no channel is given.

twitchsubscriptions [username] Import the Twitch.tv emotes available to a user given their login name.

files [path] Import all PNG files in the given directory (recursive), using each file name as a shortcode.

slack Import all of the custom emoji from a Slack team. Get an API key at https://api.slack.com/apps/.../oauth and export it in the SLACK_API_TOKEN environment variable. Requires the slack-ruby-client gem.

discord Import all of the custom emoji from a Discord server. Get a bot token at https://discordapp.com/developers/applications/me/... and export it in the DISCORD_API_TOKEN environment variable, and join the bot to your channel with the client ID here. Requires the discordrb gem.

mastodon [base url] Copy all custom emoji from an existing Mastodon instance, via its public API.

hashflags [time] Import all Twitter promoted hashtag emoji, limited to campaigns active at the given date and time, or now if no time is given.

emojipack [path or url] Import an "emojipack" YAML from the given URL or file path. Requires the safe_yaml gem.

Examples

import_emoji.rb --prefix tf --minsize 20x20 steamgame 440 Import Steam emotes for Team Fortress 2, and add a "tf" prefix to each shortcode, and expand each image to 20x20 pixels

import_emoji.rb --match "^[a-zA-Z0-9_]{2,}$" --lower twitchchannel Import Twitch.tv global emotes (but only with alphanumeric codes) and make the codes lowercase

import_emoji.rb --hide files monstrous_specification_0.1.0_png64/emoji/ Import all emoji from the (downloaded and extracted) Monstrous Specification emoji set, but hide them from the picker by default.

展开阅读全文

代码

评论

点击引领话题📣
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
0 评论
0 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部
返回顶部
顶部