e-dt

Untitled

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