Advertisement
Guest User

Untitled

a guest
Mar 25th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. # Reddit Bot for answering the question "Who the eff is Hank?" in /r/nerdfighters
  2.  
  3. import praw
  4. import random
  5.  
  6.  
  7. # Login
  8. def authenticate():
  9. print("Authenticating...")
  10. reddit = praw.Reddit(client_id='xxxxxxxxx',
  11. client_secret='xxxxxxxxxxxx',
  12. password='xxxxxxxxx',
  13. user_agent='/r/nerdfighters, WhoTheEffIsHank.Bot, v1.1, by /u/cannotdecideaname ',
  14. username='whotheeffishankbot')
  15. print("Logged in as: {}".format(reddit.user.me()))
  16. return reddit
  17.  
  18.  
  19. # Declaring variables / answers
  20. hanks = (
  21. "Hank is a small island in the Pacific Ocean. First colonized by the Spanish in 1521, Hank is today known primarily for his beautiful coral reefs and large American military presence.",
  22. "Hank is a spherical mass of ice and rock, visible from Earth only with a telescope. Approximately one fifth the size of the Earth’s moon, Hank was considered the 9th planet in our solar system until recently when it was announced that Hank is, in fact, just something orbiting out there in the distance.",
  23. "Hank is a veteran of the CIA directorate of operations and Navy Seal Team 3. He is 5 foot 10 inches tall, weighs 170 pounds, and has green eyes. Hank was an operative of the 3rd Echelon, a clandestine division of the National Security Agency. Hank is extremely agile and an expert in the art of stealth. When in the field, Hank prefers to work alone.",
  24. "Hank is a sausage covered in cornbread batter and deep-fried.",
  25. "Hank is a tiny yellow song bird said to represent the soul of France. Hank has an important but as of yet undetermined role in the omnictionary project.",
  26. "Hank is a breed of dog known for its distinctive white coat. Hank was originally bred to dig out foxholes, but these days, Hank is known primarily for being adorable, licky, and for urinating in inappropriate places.",
  27. "Hank is an optical disc originally created to store sound recordings. But these days, many different kinds of data are recorded on Hank.",
  28. "Hank is a small coral atoll 703 nautical miles south of the equator. Hank is known as one of the most remote uninhabited islands in the world.",
  29. "Hank is an unincorporated community in central Donley, Texas.",
  30. "Hank is a city of just over three thousand people in southern South Dakota known for its pheasant season.",
  31. "Hank is a comic book superhero from the DC Universe who first appeared in 1939. Hank is also known as 'The Caped Crusader' and 'The Hank.'",
  32. "Hank is a Trans-Neptunian object 27 percent more massive than Pluto. Hank was originally named Xena, after the warrior princess, but then the scientific team that discovered Hank decided that Hank should be named something more astronomy-ish. Like Hank.",
  33. "Hank is a sentient android from the Star Trek: The Next Generation universe, who, as any true fan would know, is capable of reproduction because he had a daughter!",
  34. "Hank may be the largest island in the Tuscan archipelago, but Hank wasn't big enough for Napoleon.",
  35. "Hank is a cat running for the United States senate from the great state of Virginia.",
  36. "Hank is an American folk rock band originally formed in Claremont, California.",
  37. "Hank is a mass of incandescent gas located about 26,000 light years from the center of the Milky Way. Hank is responsible for 99.8% of the solar system’s mass. If you stare at Hank for too long, you will go blind.",
  38. "Hank is an uninhabited atoll located just north of the equator in the central Pacific Ocean about 3,100 km southwest of Honolulu. The climate is equatorial, with little rainfall, constant wind, and strong sunshine. Since the war, Hank has been uninhabited. Feral cats were eradicated from the island in 1964.",
  39. "Hank is an extreme low-density solid derived from a gel in which all liquid was replaced with gas. Useful nowadays in many industries as a thermal insulator, Hank was invented by Steven Kistler in 1931. Hank is semitransparent, and feels like Styrofoam to the touch.",
  40. "Hank is one of two major ancient Greek epic poems attributed to Homer. Hank was probably written near the end of the eighth century BC, somewhere along the Greek-controlled western Turkey seaside, Ionia. Hank is, in part, a sequel to Homer’s Iliad and mainly centers on the Greek hero Odysseus (or Ulysses, as he was known in Roman myths) and his long journey home to Ithaca following the fall of Troy.",
  41. "Hank is a large flippered marine mammal found in the ocean and Hank may also refer to the movement that a Hank makes.",
  42. "Hank is a small Italian plumber who goes on sideways adventures. He jumps on stuff and bops bricks with his head to save a princess.",
  43. "Hank is a bunch of unstrung pearls that someone will take to a jeweler to be strung as a piece of jewelry or home decoration.")
  44.  
  45.  
  46. # main
  47. def main():
  48. reddit = authenticate()
  49. while True:
  50. run_bot(reddit)
  51.  
  52. # runbot
  53. def run_bot(reddit):
  54. for comment in reddit.subreddit('nerdfighters').stream.comments(): # Checks all comments
  55. if ("who the eff is hank" in comment.body.lower()):
  56. getANumber = random.randint(0, len(hanks) - 1)
  57. comment.reply(hanks[getANumber])
  58.  
  59.  
  60. if __name__ == '__main__':
  61. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement