Guest User

Untitled

a guest
Nov 6th, 2017
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. #just dont use the auto-format its not working rn
  2. import praw
  3. import webbrowser
  4. def get(text):
  5. last = ""
  6. ongoing = []
  7. this = input(text)
  8. while 1:
  9. if this == last and this == "":
  10. break
  11. ongoing.append(this)
  12. last = this
  13. this = input('')
  14. ongoing = ongoing.pop() #workaround i dont care
  15. return "\n".join(ongoing)
  16.  
  17.  
  18. def image():
  19. hastext = input("Text? [yn] ").lower() == "y"
  20. description = get("Description: ")
  21. if hastext:
  22. text = get("Text: ")
  23. return """*Image Transcription:*
  24.  
  25. ---
  26.  
  27. *[%s]*
  28.  
  29. %s
  30.  
  31. ---
  32.  
  33. ^^I'm a human volunteer content transcriber for Reddit! [If  you'd like more information on what we do and why we do it, click here!](https://www.reddit.com/r/TranscribersOfReddit/wiki/index)""" % (description, text)
  34. else:
  35. return """*Image Transcription:*
  36.  
  37. ---
  38.  
  39. *%s*
  40.  
  41. ---
  42.  
  43. ^^I'm a human volunteer content transcriber for Reddit! [If  you'd like more information on what we do and why we do it, click here!](https://www.reddit.com/r/TranscribersOfReddit/wiki/index)""" % description
  44.  
  45.  
  46.  
  47. r = praw.Reddit(client_id='e-ZdWMo3zWMqxA', client_secret="T0YrVREJw0CSHpRH5bbiCvEijlY", password="1234me", user_agent='ToR Scraper 0.2.0', username="e-dt")
  48. tor = r.subreddit('TranscribersOfReddit')
  49. already_seen = []
  50. for submission in tor.new(limit=100):
  51. if submission in already_seen:
  52. continue
  53. already_seen.append(submission) #append even if Completed etc
  54. if not submission.link_flair_text == "Unclaimed":
  55. continue
  56. webbrowser.get("chrome").open_new_tab(submission.url)
  57. webbrowser.get("chrome").open_new_tab("https://reddit.com" + submission.permalink)
  58. posttype = input("Post type? ").lower()
  59. if posttype != "":
  60. submission.reply("claim")
  61. if posttype == "4chan":
  62. ... #implement 4chan later
  63. elif posttype == "image":
  64. print(image())
  65. elif posttype == "reddit":
  66. ... #comment threading is complicated put off til later
  67. elif posttype == "facebook":
  68. ... #comment threading (thankfully only 1-level deep)
  69. elif posttype == "twitter":
  70. ... #replies are 1d thankfully
  71. elif posttype == "sms":
  72. ...
  73. elif posttype == "comic":
  74. ... #do later aaah
  75. elif posttype == "audio":
  76. ... #should actually be easy enough
  77. elif posttype == "video":
  78. ... #aaah nope
  79. else:
  80. print("Skipping...")
Add Comment
Please, Sign In to add comment