我想知道是否有一个已经写好的Bash脚本能够将图像上传到imgur.com,并且一旦过期就自动请求新的访问令牌。
在搜索这样的脚本时,我发现了一些不支持OAuth2的脚本:
来自Imgur OAuth 2.0概述的引言
Imgur API使用OAuth 2.0进行身份验证。 OAuth 2.0有四个步骤:注册,授权,发出请求,以及在初始过期后获取新的access_tokens。
在Imgur's uploading tools中搜索我发现不支持OAuth2.0的脚本,因此它们与我的案例无关。
谢谢!
几天前我写了这样一个工具:rugmi。
以下是一些使用示例:
Upload foo.png, bar.png, baz.png and print the result links to stdout.
$ rugmi -f foo.png -f bar.png -f baz.png
or
$ rugmi -- foo.png bar.png baz.png
Upload all JPEG files in a directory and print the result links to stdout.
$ find dir/ -type f -name '*.jpg' -print0 | rugmi -0
Upload foo.png and print an HTML type of link to be displayed as a medium thumbnail.
rugmi -f foo.png -t HTML -s MT