Questions tagged [tweetstream]

Tweetstream provides access to Twitter's Streaming API in python or ruby

Tweetstream for ruby

Twitter’s Streaming API is one of the most exciting developments in the Twitter API in some time. It gives you the ability to create a long-standing connection to Twitter that receives “push” updates when new tweets matching certain criteria arrive, obviating the need to constantly poll for updates. TweetStream is a Ruby library to access the new API.

to install run:

gem install tweetstream

Tweetstream for python

tweetstream for python provides two classes, SampleStream and FollowStream, that can be used to get tweets from Twitter's streaming API. An instance of one of the classes can be used as an iterator. In addition to fetching tweets, the object keeps track of the number of tweets collected and the rate at which tweets are received.

SampleStream delivers a sample of all tweets. FilterStream delivers tweets that match one or more criteria. Note that it's not possible to get all tweets without access to the "firehose" stream, which is not currently avaliable to the public.

to install run:

pip install tweetstream
88 questions
1
vote
1 answer

How to define a stable form for output tweets in getting real time tweets by python

My code works for getting real time tweets by Tweepy package of Python. I only want to get the created date and content of tweet so I define like below def on_status(self, status): tweet_text = status.text tweet_created_date =…
1
vote
2 answers

Is there a Twitter Streams API for Ruby?

Does anyone know of a Ruby gem or plugin that provides a simple interface to the Twitter Steams API?
cbrulak
  • 15,436
  • 20
  • 61
  • 101
1
vote
1 answer

how to get twitter top tweets in specific language?

With this url you can get the 100 best recent tweets which have the word 'ALI': https://api.twitter.com/1.1/search/tweets.json?q=ALI&result_type=popular&count=100&lang=en But how can we keep q empty ? I just want to get the top tweets by language…
Ali
  • 67
  • 1
  • 7
1
vote
3 answers

What should be flume.conf parametres for save tweets to single FlumeData file per hour?

We are saving tweets in a directory order like /user/flume/2016/06/28/13/FlumeData... .But each hour it creates more than 100 FlumeData file.I have changed TwitterAgent.sinks.HDFS.hdfs.rollSize = 52428800 (50 mb) same thing happened again.After that…
mgurcan
  • 170
  • 1
  • 12
1
vote
0 answers

Python - how to get tweets in real time by hashtag

I am looking for a pythonic way to get a stream of tweets by hashtag. What I found so far is the tweepy package using this code: from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener class…
farhawa
  • 10,120
  • 16
  • 49
  • 91
1
vote
1 answer

Where in Rails Project to Place Code

I am attempting to classify whether or not tweets are geo-tagged based on certain keywords using the Ruby Twitter Gem. I can do this just fine from the rails console, but I went to reflect my findings in a view, and I just don't know how to do…
1
vote
0 answers

Can we get tweets for last 4 months... suppose I am pulling tweets in April.. is there any way to get all the tweets since 1st Jan to 1st april ??

Can we get tweets for last 4 months... suppose I am pulling tweets in April.. is there any way to get all the tweets since 1st Jan to 1st april? I tried using below command but I am not getting tweets since Jan.. tweets <- searchTwitter ("India",…
user1118098
  • 101
  • 1
  • 1
  • 2
1
vote
0 answers

Search the twitter stream based on keyword, username and date interval

I would like to write a program that can pull tweets from Twitter based on keywords, usernames and a date range. I have used Tweepy to write a program to extract tweets from the Streaming API. Currently, it brings tweets based on keywords OR…
bkm
  • 109
  • 1
  • 8
1
vote
0 answers

Twitter streaming API, where to find originator's name?

I am using Python to stream Twitter's Tweets via API. For example, the word "car" generates the following results: { "created_at": "Fri Sep 05 00:15:32 +0000 2014", "id": 507683414255108096, "id_str": "507683414255108096", "text": "I…
KubiK888
  • 4,377
  • 14
  • 61
  • 115
1
vote
2 answers

sinatra and tweetstream wont work together

i am trying to capture the twitter stream for a specific hashtag to pass it on as another http stream. the code i have written (i'm new to ruby) looks like this: require 'tweetstream' require 'sinatra' set :server, 'webrick' …
stephanlindauer
  • 1,910
  • 2
  • 14
  • 17
1
vote
1 answer

Mocking out TweetStream in Rails

I'm making an app where one of my key pieces of code is executed whenever I receive a status update from an instance of the TweetStream gem's user stream client, and I'm getting to the point where I really need Unit Tests to make sure the code acts…
Pat Marx
  • 319
  • 2
  • 12
1
vote
1 answer

heroku running a daemon process

I'm trying to run a deamon process running on heroku. The framework-less app is just a ruby script which after being launched monitors my twitter stream and if there is a tweet with a photo then publish it on a tumblr. Locally it runs just fine, but…
Jacopo
  • 37
  • 5
1
vote
1 answer

Tweetstream count tweets and write file every 10 minutes

i have a little script wich is taking the number of tweets using tweetstream and write that to a file, but i see there is a limit of 50/s, maybe because the file IO, i want to try to store the value in a variable and then, every 10 minutes write the…
mijailr
  • 71
  • 1
  • 12
1
vote
1 answer

How Do I Run a Tweetstream Loop on Heroku?

I have a fairly simple Tweetstream listener built in a Sinatra app that I am trying to get running on Heroku. It gets up and running fine, but after about a minute I get the following error: 2012-12-04T06:23:31+00:00 heroku[web.1]: Stopping process…
DorkRawk
  • 732
  • 2
  • 6
  • 21
1
vote
1 answer

Restrict only geotagged tweets to flow through to mongodb

I am currently making use of Tweetstream to store tweets in MongoDB. I have setup a script that im running with python 2.7: extent =["144.715, -38.03", "145.219, -37.541"] with tweetstream.FilterStream(username, password, locations=extent) as…
jakc
  • 1,161
  • 3
  • 15
  • 42