Open Julenho opened 4 years ago
import tweepy import csv
f3 = csv.reader(open("/tmp/acessostw.csv","r")) msg = '' consumer_key = "xxxxxxxxxxxxxxx" consumer_secret = "xxxxxxxxxxxxxxxx" access_token = 'xxxxxxxxxxxxxxxx' access_token_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) myapi = tweepy.API(auth)
for x in f3: lista_x = str(x).split() l_lista = len(lista_x)
for y in range(l_lista):
data = lista_x[2]+'/'+lista_x[1]+', '+'Hora: '+lista_x[3]
porta = lista_x[9]
ip = lista_x[13]
mensag = data+', '+porta+', '+ip+'\n'
msg += mensag
myapi.update_status(msg)
apt install python-pip pip install tweepy