"""
author: Zack Schwartz (zacharyhschwartz@gmail.com)
date created: 11/13/2011
"""

from multiprocessing import Process
from ..components.stream import *

class StreamController(Process):
    consumer_key = "nAn44b3ckVIdi3HBaUAopg"
    consumer_secret = "WNw3NH4CZAkO5yKmuooujgniRrDvvtJ3b3qSvVWKoA"

    access_token = "40829082-CGCa1y9nzKF2rl7flsYmVKe2uXHdFw741M52obAKU"
    access_token_secret = "bjuzxACf9lm2wgImiove5GfdWsRno72uEqedCzPJQ1k"

    def __init__(self):
        Process.__init__(self)

    def run(self):
        auth = tweepy.OAuthHandler(self.consumer_key, self.consumer_secret)
        auth.set_access_token(self.access_token, self.access_token_secret)
        api = tweepy.API(auth)
        print api.me().name

        stream = tweepy.streaming.Stream(auth, BauerStreamListener(),
                                         timeout=600)
                                         
                              
        stream.sample()
        print "test..."
    
