Пример #1
0
def send_tweets(server):
    track = config.get('search_for').split(',')

    auth = tweepy.auth.OAuthHandler(config.get('twitter_key'),
                                    config.get('twitter_secret'))
    auth.set_access_token(config.get('twitter_access_token'),
                          config.get('twitter_access_secret'))
    listener = StreamListener(broadcast_msg, server, '/tweets', 'tweet', words=track)
    streamer = tweepy.Stream(auth=auth, listener=listener, secure=True,
                             retry_count=2)

    streamer.filter(track=track)
Пример #2
0
def my_view(request):
    google_maps_key = config.get('google_maps_key')
    return {'google_maps_key': google_maps_key}