imgur

imgur.py

回眸只為那壹抹淺笑 提交于 2019-11-29 10:43:06
# !/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import with_statement import sys import os import urllib2 from urlparse import urlparse import random import re import gevent from gevent import monkey monkey.patch_all() def get(url): setup = urllib2.build_opener() # TODO: Write appropriate headers. setup.add_headers = [( ' None ' , ' None ' )] urllib2.install_opener(setup) try : request = urllib2.Request(url) except (urllib2.HTTPError, urllib2.URLError), e: sys.exit( -1 ) return setup.open(request) def is_url(url): res = urlparse(url) return ' imgur.com ' in res.netloc def fetch

using imgur api v3 to upload images anonymously using php

半腔热情 提交于 2019-11-28 17:56:38
问题 I am planning to upload images to imgur anonymously using its api, i registered my application in the anonymous upload category and got client id and client secret, How to use php to upload image to imgur and retrieve direct url to the image? can anyone suggest links to any example? this is what I have tried to do but i get the error "Fatal error: Maximum execution time of 30 seconds exceeded" <?php $client_id = :client_id; //put your api key here $filename = "images/q401x74ua3402.jpg";

The type List is not generic; it cannot be parameterized with arguments [HTTPClient]

丶灬走出姿态 提交于 2019-11-28 17:44:04
import java.awt.List; import java.awt.image.BufferedImage; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.InputStreamReader; import java.util.ArrayList; import javax.imageio.ImageIO; import org.apache.commons.codec.binary.Base64; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import org.omg

Upload images to Imgur from Mathematica

与世无争的帅哥 提交于 2019-11-28 17:10:23
Here's a challenge to all mathematica tag followers. Let's make it a lot more convenient to insert images into SO post from Mathematica by creating an imgur uploader. How can we create a function imgur[g_] that will rasterize its argument (making sure that the final size is not wider than the width of StackOverflow posts), convert it to PNG, upload it to imgur, and return a ready to be pasted MarkDown line such as ![Mathematica graphic](http://i.imgur.com/ZENa4.jpg) ? Useful references: Imgur API Example of using POST request from Mathematica on WRI blog (posting to Twitter) by ragfield

CORS issues with jQuery Dropzone and upload to Imgur

只谈情不闲聊 提交于 2019-11-28 11:33:13
I tried to use jQuery Dropzone to upload an image to Imgur or any other domain but that's not working. This is my dropzone setup: $("div.dropzone").dropzone success: -> console.log arguments paramName: "image" method: "post" maxFilesize: 2 url: "https://api.imgur.com/3/upload" headers: Authorization: "Client-ID *************" This doesn't work. It says that return code is 0. The request headers: Host: api.imgur.com User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Firefox/31.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: fr,fr-fr;q=0.8

Upload image to imgur failed because of cors

前提是你 提交于 2019-11-28 11:02:15
问题 I'm trying to upload an image to imgur with js (browser) and get a CORS error: Access to XMLHttpRequest at 'https://api.imgur.com/3/upload' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. But preflight request contains Access-Control-Allow-Origin header: The request itself: What I'm missing? this is because access-control-allow-credentials set to true ? 回答1: The problem was with their API Docs :

The type List is not generic; it cannot be parameterized with arguments [HTTPClient]

老子叫甜甜 提交于 2019-11-27 10:41:09
问题 import java.awt.List; import java.awt.image.BufferedImage; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.InputStreamReader; import java.util.ArrayList; import javax.imageio.ImageIO; import org.apache.commons.codec.binary.Base64; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http

Upload images to Imgur from Mathematica

独自空忆成欢 提交于 2019-11-27 10:14:44
问题 Here's a challenge to all mathematica tag followers. Let's make it a lot more convenient to insert images into SO post from Mathematica by creating an imgur uploader. How can we create a function imgur[g_] that will rasterize its argument (making sure that the final size is not wider than the width of StackOverflow posts), convert it to PNG, upload it to imgur, and return a ready to be pasted MarkDown line such as ![Mathematica graphic](http://i.imgur.com/ZENa4.jpg) ? Useful references: Imgur

Google chrome rehost image extension

烈酒焚心 提交于 2019-11-27 02:11:58
I would like to have a Google Chrome extension to rehost any image I click on. For example, I have a html document with images using <img> tag. I want to have a extension which will rehost that image to an another image host. I saw something like this with the imgur extension . I have no clue where should i begin or what should I do to get this work. Thanks for your help in advance! First, you have to get an API key. If a maximum of 50 uploads per hour is sufficient, and you don't want to register an account, get an anonymous API key . Instead of binding a left-click event handler, which may

Accessing imgUr thru OAuth (uploading to user account)

旧巷老猫 提交于 2019-11-26 19:12:06
To start doing this "simple" task I've researched for a procedure that I've taken as an example here to follow and reproduce the steps, the procedure can upload an image "anonymously": Private ReadOnly ClientId As String = "My Client ID" ' => "..............." Private ReadOnly ClientSecret As String = "My Client Secret" ' => "........................................" ' Usage: ' Dim url As String = UploadImage("C:\Image.jpg") : MessageBox.Show(url) Public Function UploadImage(ByVal image As String) Dim w As New WebClient() w.Headers.Add("Authorization", "Client-ID " & ClientId) Dim Keys As New