imgur

PHP: Uploading multiple images to imgur at once

左心房为你撑大大i 提交于 2019-12-08 10:10:25
问题 I've got the following code and it works perfectly fine for uploading one image to Imgur using their API: $client_id = $myClientId; $file = file_get_contents($_FILES["file"]["tmp_name"]); $url = 'https://api.imgur.com/3/image.json'; $headers = array("Authorization: Client-ID $client_id"); $pvars = array('image' => base64_encode($file)); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL=> $url, CURLOPT_TIMEOUT => 30, CURLOPT_POST => 1, CURLOPT_RETURNTRANSFER => 1, CURLOPT

403 error while getting data from Imgur api. Where am I going wrong?

北慕城南 提交于 2019-12-08 05:40:27
问题 From the imgur api page: For public read-only and anonymous resources, such as getting image info, looking up user comments, creating an anonymous album, etc. all you need to do is send an authorization header with your client_id along with your requests. This also works if you'd like to upload images anonymously (without the image being tied to an account). This lets us know which application is accessing the API. This is my request using python-requests: payload = {"Client-ID":"my client id

Imgur API uploading

狂风中的少年 提交于 2019-12-08 02:15:23
问题 So there is this line of code String data = URLEncoder.encode("image", "UTF-8") + "=" + URLEncoder.encode(Base64.encodeBase64String(baos.toByteArray()).toString(), "UTF-8"); data += "&" + URLEncoder.encode("key", "UTF-8") + "=" + URLEncoder.encode(YOUR API KEY GOES HERE, "UTF-8"); and when I registered for the Imgur API I was given a client_id and a client_secret and was wondering which one I use for where it says "YOUR API KEY GOES HERE" also in the first part in the second line where it

Imgur API uploading

家住魔仙堡 提交于 2019-12-06 04:29:50
So there is this line of code String data = URLEncoder.encode("image", "UTF-8") + "=" + URLEncoder.encode(Base64.encodeBase64String(baos.toByteArray()).toString(), "UTF-8"); data += "&" + URLEncoder.encode("key", "UTF-8") + "=" + URLEncoder.encode(YOUR API KEY GOES HERE, "UTF-8"); and when I registered for the Imgur API I was given a client_id and a client_secret and was wondering which one I use for where it says "YOUR API KEY GOES HERE" also in the first part in the second line where it says "key" what do I enter there? Also is the site to upload it http://imgur.com/api/upload because I have

uploading a file to imgur via python

我只是一个虾纸丫 提交于 2019-12-05 17:40:09
I'm having trouble uploading an image to Imgur using the python requests module and the Imgur API. My code is the following: import base64 import json import requests from base64 import b64encode client_id = 'my-client-id' headers = {"Authorization": "Client-ID my-client-id"} api_key = 'my-api-key' url = "http://api.imgur.com/3/upload.json" j1 = requests.post( url, headers = headers, data = { 'key': api_key, 'image': b64encode(open('1.jpg', 'rb').read()), 'type': 'base64', 'name': '1.jpg', 'title': 'Picture no. 1' } ) I usually get a 400 response error. I'm not sure if myu client_id is wrong,

uploading to Imgur v3 using Java https errors

巧了我就是萌 提交于 2019-12-05 10:13:41
I'm currently trying to upload to imgur using their current API v3, however I keep getting the error error: javax.net.ssl.SSLException: hostname in certificate didn't match: api.imgur.com != imgur.com OR imgur.com The error is pretty self-explaintory so I thought I would try using http instead but I get the error code 400 with imgur. I am not sure if this means how I am trying to upload is wrong or if Imgur doesn't like not SSL connections. Below is my module of code connecting to Imgur: public String Imgur (String imageDir, String clientID) { //create needed strings String address = "https:/

How do I upload to an imgur user's account

て烟熏妆下的殇ゞ 提交于 2019-12-04 16:15:11
I am able to upload anonymous images to imgur using the api like this: public static void UploadImage() { Image image = GetImage(); string base64 = Util.ImageToBase64(image); using (WebClient client = new WebClient()) { client.Headers.Add("Authorization", "Client-ID " + clientID); NameValueCollection data = new NameValueCollection(); data["image"] = base64; data["type"] = "base64"; byte[] responsePayload = client.UploadValues("https://api.imgur.com/3/image/", "POST", data); string response = Encoding.ASCII.GetString(responsePayload); } } It's uploading to a completely random url. I couldn't

Uploading a png to imgur using javascript

匆匆过客 提交于 2019-12-03 07:55:08
I'm trying to use Javascript to upload a png to imgur . I've used the code directly from the Imgur API example , but I don't think I am passing the png file properly as I get an error message saying file.type is undefined . I think the file is ok as I've tried this with a few different pngs. My code is as follows: <html> <head> <script type="text/javascript"> function upload(file) { // file is from a <input> tag or from Drag'n Drop // Is the file an image? if (!file || !file.type.match(/image.*/)) return; // It is! // Let's build a FormData object var fd = new FormData(); fd.append("image",

representing a character at various array in an html table w/JQuery/JavaScript

匿名 (未验证) 提交于 2019-12-03 02:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've run into some issue graphically representing some of my data via J Query in my Hangman game- right now I'm working on the last part of my play(space) function to take into account if there is more than one correctly guessed letter in a word & to display all instances of that letter- I've made a function to loop through the array created out of the split word, I'm getting the correct indexes of those letters, I'm just kind of stuck as to how to display these letters at these indexes in my table via J Query correctly & I'm kind of stuck..

Disable right click on specific &lt;div&gt; or class=“” [closed]

匿名 (未验证) 提交于 2019-12-03 02:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is my sample code: html <div> This is the Phone and NO ONE SHOULD RIGHT CLICK THIS! >:) </br> <img class="tlClogo" src="http://i.imgur.com/0atiS5C.jpg" style="height: 120px; width:120px;"> </div></br></br></br></br> And this is the Keyboard, ofcourse yo can right click this :)</br> <img src="http://i.imgur.com/xkrKz1X.jpg" style="height: 120px; width:120px;"> js $('img').bind('contextmenu', function(e){ alert("This Logo is protected");return false; }); fiddle I want no one to be able to right click the 1st picture (cellphone) but other