Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. def Exas():
  2. import praw
  3. imgcount = 0
  4. reddit = praw.Reddit(client_id='CENSORED',
  5. client_secret='CENSORED',
  6. user_agent='TheBigScraper(By u/scrappermaster)',
  7. username='scrappermaster',
  8. password='thescrapperisscrap')
  9.  
  10. listoftitles = []
  11. listofurls = []
  12.  
  13. # whichone = input('what subreddit do you want to access? ')
  14. # endlimit = input('what number of pictures do you want to download? ')
  15. whichoner = whichone
  16. ender = int(endlimit.get())
  17.  
  18. subreddit = reddit.subreddit(whichone)
  19. for submission in subreddit.hot(limit=int(ender)):
  20. title = submission.title
  21. link = submission.url
  22. Both = title + " " + link
  23. if '.jpg' in link :
  24. listofurls.append(link)
  25. listoftitles.append(title)
  26.  
  27. import tkinter as tk
  28.  
  29. root = tk.Tk()
  30.  
  31.  
  32. root.title("InstagramBot")
  33.  
  34. root.geometry('320x125')
  35.  
  36. whichone = str(tk.StringVar())
  37. endlimit = tk.StringVar()
  38.  
  39. lblWhichone = tk.Label(root, text = 'Subreddit Name:').grid(row = 0, column = 0, padx = 0, pady = 10)
  40. entWhichone = tk.Entry(root, textvariable = whichone).grid(row = 0, column = 1)
  41.  
  42. lblIntendlimit = tk.Label(root, text = 'Number of Pictures:').grid(row = 1, column = 0, padx = 0, pady = 10)
  43. entendlimit = tk.Entry(root, textvariable = endlimit).grid(row = 1, column = 1)
  44.  
  45. btn = tk.Button(root, text = 'Execute', command = Exas, fg='red', font='Helvetica 18 bold').grid(row = 5, column = 1)
  46. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement