一个Bash脚本,用于将图像上传到imgur.com,自动询问新的access_token

问题描述 投票:1回答:1

我想知道是否有一个已经写好的Bash脚本能够将图像上传到imgur.com,并且一旦过期就自动请求新的访问令牌。

在搜索这样的脚本时,我发现了一些不支持OAuth2的脚本:

来自Imgur OAuth 2.0概述的引言

Imgur API使用OAuth 2.0进行身份验证。 OAuth 2.0有四个步骤:注册,授权,发出请求,以及在初始过期后获取新的access_tokens。

Imgur's uploading tools中搜索我发现不支持OAuth2.0的脚本,因此它们与我的案例无关。

谢谢!

bash oauth-2.0 command-line-interface image-uploading imgur
1个回答
3
投票

几天前我写了这样一个工具: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
© www.soinside.com 2019 - 2024. All rights reserved.