Created
April 29, 2017 18:43
-
-
Save MayankPratap/233c7b5c703d9207b6177fc35e993b59 to your computer and use it in GitHub Desktop.
random stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import random | |
#import cStringIO | |
import base64 | |
from base64 import b64encode | |
#import pyimgur | |
#import picamera | |
import pickle | |
from imgurpython import ImgurClient | |
IMAGE_DIR="/home/mayank/Documents/robotics-club/" | |
IMG="elonmusk.jpg" | |
TXT_MSG="someoneatdoor" | |
# imgur client | |
client_id="8467e45ef6d8e3a" | |
client_secret="a37d0bc108060b6e2cb6fe60d6ff9cbe45efbaaf" | |
client=ImgurClient(client_id,client_secret) | |
#im.refresh_access_token() | |
#image=im.get_image('S1jmapR') | |
#headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0'} | |
uploaded_image=client.upload_from_path(IMAGE_DIR+IMG,config=None,anon=True) | |
#media_url=uploaded_image.link | |
#print(media_url) | |
#print(image.title) | |
#print(image.link) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment