一个Bash脚本,可将图像自动上传到imgur.com,要求新的access_token [英] A Bash script to upload images to imgur.com automatically asking for new access_token

查看:78
本文介绍了一个Bash脚本,可将图像自动上传到imgur.com,要求新的access_token的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否已经编写了 Bash脚本,该脚本能够将图像连同一起上传到imgur.com,并自动完成请求新访问令牌的过程

I was wondering if there's an already written Bash script which will be capable of uploading images to imgur.com along with automating the process of requesting new access token once it expire.

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

Searching for such a script I found a few which do not support OAuth2:

引自Imgur的OAuth2.0概述

Quoted from Imgur's OAuth2.0 overview


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

The Imgur API uses OAuth 2.0 for authentication. OAuth 2.0 has four steps: registration, authorization, making the request, and getting new access_tokens after the initial one expired.

Imgur的上传工具我发现脚本不支持OAuth2.0,因此与我的情况无关。

Searching in Imgur's uploading tools I found scripts that do not support OAuth2.0, therefore they are not relevant for my case.

谢谢!

推荐答案

几天前,我写了这样一个工具: rugmi

I wrote such a tool a few days ago: 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

这篇关于一个Bash脚本,可将图像自动上传到imgur.com,要求新的access_token的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆