title: RxPy - Turn Live Twitter Stream into Rx Observable?
body: <p>I followed along this <a href="http://adilmoujahid.com/posts/2014/07/twitter-analytics/" rel="nofollow noreferrer">great tutorial</a> to leverage a live Twitter stream in Python using tweepy. This will print Tweets in live time that mention RxJava, RxPy, RxScala, or ReactiveX. </p>
  
  <pre><code>from tweepy.streaming import StreamListener
  from tweepy import OAuthHandler
  from tweepy import Stream
  from rx import Observable, Observer
  
  #Variables that contains the user credentials to access Twitter API
  access_token = "CONFIDENTIAL"
  access_token_secret = "CONFIDENTIAL"
  consumer_key = "CONFIDENTIAL"
  consumer_secret = "CONFIDENTIAL"
  
  
  #This is a basic listener that just prints received tweets to stdout.
  class TweetObserver(StreamListener):
  
      def on_data(self, data):
          print(data)
          return True
  
      def on_error(self, status):
          print(status)
  
  
  
  if __name__ == '__main__':
  
      #This handles Twitter authetification and the connection to Twitter Streaming API
      l = TweetObserver()
      auth = OAuthHandler(consumer_key, consumer_secret)
      auth.set_access_token(access_token, access_token_secret)
      stream = Stream(auth, l)
  
      #This line filter Twitter Streams to capture data by the keywords: 'python', 'javascript', 'ruby'
      stream.filter(track=['rxjava','rxpy','reactivex','rxscala'])
  </code></pre>
  
  <p>This is the perfect candidate to turn into a <a href="http://reactivex.io/" rel="nofollow noreferrer">ReactiveX</a> Observable via <a href="https://github.com/ReactiveX/RxPY" rel="nofollow noreferrer">RxPy</a>. But how exactly do I turn this into a hot source <code>Observable</code>? I cannot seem to find documentation anywhere on how to perform an <code>Observable.create()</code>...</p>