Skip to content

Instantly share code, notes, and snippets.

@WillisN
Created September 29, 2020 02:08
Show Gist options
  • Save WillisN/17b39a9c9363e592dc093a883cc63f32 to your computer and use it in GitHub Desktop.
Save WillisN/17b39a9c9363e592dc093a883cc63f32 to your computer and use it in GitHub Desktop.
main
def main():
TCP_IP = "localhost"
TCP_PORT = 9009
conn = None
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((TCP_IP, TCP_PORT))
s.listen(1)
print("Waiting for TCP connection...")
conn, addr = s.accept()
print("Connected... Starting getting tweets.")
resp = get_tweets()
send_tweets_to_spark(resp, conn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment