<commit_before>#encoding: utf-8
"""
from twitter import Twitter
twitter = Twitter.getTwitter()
q = twitter.search(q='scioli')
print q['search_metadata']
for t in q['statuses']:
  print t
"""

import tweetstream
import time
import threading
from twython import TwythonStreamer
from pymongo import MongoClient
from datetime import datetime,  timedelta
from rulesmanager import getBrandClassifiers
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--auth', action="store_true", default=False)
args = parser.parse_args()
dbuser = "monitor"
dbpasswd = "<PASSWORD>"
mclient = MongoClient()
db = mclient['unilever']
if args.auth:
    db.authenticate(dbuser, dbpasswd)
monitor = mclient['monitor']
if args.auth:
    monitor.authenticate(dbuser, dbpasswd)


#db.authenticate("pablo", "1234")

"""
words = ["opera", "firefox", "safari"]
#people = [123,124,125]
locations = ["-122.75,36.8", "-121.75,37.8"]
with tweetstream.FilterStream("pablobesada", "paddle26", track=words, locations=locations) as stream:<commit_msg>cambios<commit_after>#encoding: utf-8
"""
from twitter import Twitter
twitter = Twitter.getTwitter()
q = twitter.search(q='scioli')
print q['search_metadata']
for t in q['statuses']:
  print t
"""

#import tweetstream
import time
import threading
from twython import TwythonStreamer
from pymongo import MongoClient
from datetime import datetime,  timedelta
from rulesmanager import getBrandClassifiers
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--auth', action="store_true", default=False)
args = parser.parse_args()
dbuser = "monitor"
dbpasswd = "<PASSWORD>"
mclient = MongoClient()
db = mclient['unilever']
if args.auth:
    db.authenticate(dbuser, dbpasswd)
monitor = mclient['monitor']
if args.auth:
    monitor.authenticate(dbuser, dbpasswd)


#db.authenticate("pablo", "1234")

"""
words = ["opera", "firefox", "safari"]
#people = [123,124,125]
locations = ["-122.75,36.8", "-121.75,37.8"]
with tweetstream.FilterStream("pablobesada", "paddle26", track=words, locations=locations) as stream:
{'fraction_non_alphanumeric': 0.14146815751093825, 'fraction_numerical': 0.031113271754982984, 'mean_word_length': 6.594095940959409, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7001384', 'n_tokens_mistral': 738, 'n_tokens_neox': 671, 'n_words': 171}