All Projects → DamienDennehy → Imgur.API

DamienDennehy / Imgur.API

Licence: MIT license
Imgur.API is a .NET implementation of Imgur's API.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Imgur.API

BackgroundTransfer-Example
An example project looking at how to implement background transfers on iOS
Stars: ✭ 19 (-51.28%)
Mutual labels:  imgur, imgur-api
saveddit
Bulk Downloader for Reddit
Stars: ✭ 130 (+233.33%)
Mutual labels:  imgur, imgur-api
imgur-scraper
Retrieve years of imgur.com's data without any authentication.
Stars: ✭ 26 (-33.33%)
Mutual labels:  imgur, imgur-api
imgurbash2
A shell script that uploads/deletes images to/from IMGUR.
Stars: ✭ 41 (+5.13%)
Mutual labels:  imgur, imgur-api
walgur
💻 Set your desktop background from randomly picked Imgur links! 🖼️
Stars: ✭ 20 (-48.72%)
Mutual labels:  imgur, imgur-api
Imgursniper
📷 A quick and easy Image, Screenshot and Screen recording sharing tool
Stars: ✭ 69 (+76.92%)
Mutual labels:  imgur
Meme
A command line utility for creating memes
Stars: ✭ 221 (+466.67%)
Mutual labels:  imgur
Fileshare
Debian/Ubuntu applet for screenshots and images sharing using popular online services
Stars: ✭ 35 (-10.26%)
Mutual labels:  imgur
Mac2imgur
⬆ A simple Mac app designed to make uploading images and screenshots to Imgur quick and effortless.
Stars: ✭ 914 (+2243.59%)
Mutual labels:  imgur
imgur-links-rewriting-on-ptt
Rewrite imgur links to bypass referrer check.
Stars: ✭ 19 (-51.28%)
Mutual labels:  imgur
slip
Select and upload screenshots, gifs, and screencasts to imgur and gfycat with help of slop.
Stars: ✭ 25 (-35.9%)
Mutual labels:  imgur
Picgo
🚀A simple & beautiful tool for pictures uploading built by vue-cli-electron-builder
Stars: ✭ 15,358 (+39279.49%)
Mutual labels:  imgur
Imguralbumbot
A reddit bot for linking direct images of single-picture albums
Stars: ✭ 107 (+174.36%)
Mutual labels:  imgur
Sharex
ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of files to many supported destinations you can choose from.
Stars: ✭ 18,143 (+46420.51%)
Mutual labels:  imgur
Imgur To Folder
Download Imgur albums and images to desired folder
Stars: ✭ 65 (+66.67%)
Mutual labels:  imgur
ScreenEat
screenshot made delicious
Stars: ✭ 54 (+38.46%)
Mutual labels:  imgur
Clinet
Official repository for Clinet, a Discord bot intended for assistance and control within your guilds.
Stars: ✭ 28 (-28.21%)
Mutual labels:  imgur
Gnome Shell Screenshot
Gnome Shell extension for making and uploading screenshots
Stars: ✭ 163 (+317.95%)
Mutual labels:  imgur
pmss
pmss (Poor Man's Screenshooter) is a simple screen capture script.
Stars: ✭ 13 (-66.67%)
Mutual labels:  imgur
Node Imgur
Upload images to imgur.com
Stars: ✭ 161 (+312.82%)
Mutual labels:  imgur

Imgur.API

Imgur.API is a .NET implementation of Imgur's API.

Build

Quality Gate Status

NuGet

Getting Started

Register Client

Register your App at https://api.imgur.com/oauth2/addclient

Creating an ApiClient

var apiClient = new ApiClient("YOUR_CLIENT_KEY");

Using OAuth

Getting an Authorization Url

The Authorization Url should be loaded in a browser, allowing the user to login to Imgur.

var apiClient = new ApiClient("YOUR_CLIENT_KEY", "YOUR_CLIENT_SECRET");
var httpClient = new HttpClient();

var oAuth2Endpoint = new OAuth2Endpoint(apiClient, httpClient);
var authUrl = oAuth2Endpoint.GetAuthorizationUrl();

Once user has logged in, they are redirected to your previously set Url. Once the token information is available and parsed create a token.

var token = new OAuth2Token
{
    AccessToken = "YOUR_TOKEN",
    RefreshToken = "YOUR_REFRESH_TOKEN",
    AccountId = YOUR_ACCOUNT_ID,
    AccountUsername = "YOUR_ACCOUNT_PASSWORD",
    ExpiresIn = YOUR_EXPIRATION,
    TokenType = "YOUR_TOKEN"
};

Then set the token on the ApiClient.

apiClient.SetOAuth2Token(token);

Continue to use the rest of the Endpoints.

var imageEndpoint = new ImageEndpoint(apiClient, httpClient);

Uploading Images & Video

Uploading Image

var apiClient = new ApiClient("YOUR_CLIENT_KEY");
var httpClient = new HttpClient();

var filePath = "PATH_TO_YOUR_IMAGE";
using var fileStream = File.OpenRead(filePath);

var imageEndpoint = new ImageEndpoint(apiClient, httpClient);
var imageUpload = await imageEndpoint.UploadImageAsync(fileStream);

Uploading Video

var apiClient = new ApiClient("YOUR_CLIENT_KEY");
var httpClient = new HttpClient();

var filePath = "PATH_TO_YOUR_IMAGE";
using var fileStream = File.OpenRead(filePath);

var imageEndpoint = new ImageEndpoint(apiClient, httpClient);
var imageUpload = await imageEndpoint.UploadVideoAsync(fileStream);

Uploading Video with Progress

var apiClient = new ApiClient("YOUR_CLIENT_KEY");
var httpClient = new HttpClient();

var uploadProgress = new Progress<int>(report);

var filePath = "PATH_TO_YOUR_IMAGE";
using var fileStream = File.OpenRead(filePath);

var imageEndpoint = new ImageEndpoint(apiClient, httpClient);
var imageUpload = await imageEndpoint.UploadVideoAsync(fileStream, progress: uploadProgress);

void report(int byteProgress)
{
    //Do something with the progress here. 
}

API Definition

Several Endpoints are available. The methods on the Endpoints match what is available at the official Imgur API at https://apidocs.imgur.com/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].