Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaan812 authored Dec 4, 2021
1 parent 986a2ad commit c490478
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions profilepicturebot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from tkinter import *
import PIL.ImageTk
import PIL.Image
from instagramy import InstagramUser
import urllib.request
import cv2
session_id='49579652208%3A0Ai6EUM1flNtBS%3A28'



def displayprofilepicture():
name=username.get()
try:
user=InstagramUser(name,sessionid=session_id)
profilepictureurl=user.profile_picture_url
urllib.request.urlretrieve(profilepictureurl, ("profilephotos/%s.jpg" %username))
cv2.imshow("image",cv2.imread("profilephotos/.!entry.jpg"))
except:
print("incorrect username")




master = Tk()
Label(master, text='Username').grid(row=0,column=0)
username= Entry(master)
username.grid(row=0,column=1)
submitbutton=Button(master,text="Submit",width=10,command=displayprofilepicture).grid(row=1,column=1)
master.mainloop()

0 comments on commit c490478

Please sign in to comment.