Giter VIP home page Giter VIP logo

imgur-python's Introduction

Imgur API Example Usage

This is a demo application of the Imgur API. It can be used to interrogate the Imgur API and examine its responses, as a simple command line utility, and it can be used as a library for working with the Imgur API.

You must register your client with the Imgur API, and provide the client ID to do any request to the API. If you want to perform actions on accounts, the user will have to authorize it through OAuth. The secret field is required for OAuth.

Installation

pip install imgurpython

Usage

Usage: python main.py (action) [options...]

OAuth Actions

credits
View the rate limit information for this client

authorize
Start the authorization process

authorize [pin]
Get an access token after starting authorization

refresh [refresh-token]
Return a new OAuth access token after it's expired

Unauthorized Actions

upload [file]
Anonymously upload a file

list-comments [hash]
Get the comments (raw JSON) for a gallery post

get-album [id]
Get information (raw JSON) about an album

get-comment [id]
Get a particular comment (raw JSON) for a gallery comment

get-gallery [hash]
Get information (raw JSON) about a gallery post

Authorized Actions

upload-auth [access-token]
Upload a file to your account

comment [access-token] [hash] [text ...]
Comment on a gallery post

vote-gallery [token] [hash] [direction]
Vote on a gallery post. Direction either 'up', 'down', or 'veto'

vote-comment [token] [id] [direction]
Vote on a gallery comment. Direction either 'up', 'down', or 'veto'

Config

Configuration is done through the config.json file in JSON format. The contents of the file should be a JSON object with the following properties:

client_id

Key: 'client_id'

Type: String [16 characters]

Description: The client ID you got when you registered. Required for any API call.

secret

Key: 'secret'

Type: String [40 characters]

Description: The client secret you got when you registered, if you want to do OAuth authentication.

token_store

Key: 'token_store'

Type: Object

Description: Future configuration to control where the tokens are stored for persistent insecure storage of refresh tokens.

imgur-python's People

Contributors

charley-peng avatar jacobgreenleaf avatar jasdev avatar poorlonesomecoder avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.