<reponame>Teebr/Teebr<filename>collect_stream.py
# -*- coding: UTF-8 -*-
from sys import argv
from teebr.data_stream import collect

def read_words(path):
    with open(path) as f:
        words = []
        for k in f:
            k = k.strip().split(" ", 2)[0]
            if k:
                words.append(k)
    return words


if __name__ == '__main__':
    kw = read_words("keywords.txt")
    accounts = read_words("accounts.txt")

    raw = False

    if len(argv) > 1 and argv[1] == "raw=true":
        print "Collecting raw tweets..."
        raw = True

    collect(raw=raw, keywords=kw, follow_ids=accounts)

# -*- coding: UTF-8 -*-
from sys import argv
from teebr.data_stream import collect

def read_words(path):
    with open(path) as f:
        words = []
        for k in f:
            k = k.strip().split(" ", 2)[0]
            if k:
                words.append(k)
    return words


if __name__ == '__main__':
    kw = read_words("keywords.txt")
    accounts = read_words("accounts.txt")

    raw = False

    if len(argv) > 1 and argv[1] == "raw=true":
        print "Collecting raw tweets..."
        raw = True

    collect(raw=raw, keywords=kw, follow_ids=accounts)
# -*- coding: UTF-8 -*-