Skip to content

Instantly share code, notes, and snippets.

@WillisN
Created Sep 29, 2020
Embed
What would you like to do?
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