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
0
votes
3 answers

Transferring Twitter Tweets to a txt file

from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener import json from pprint import pprint data_file = open('twitter.json') data = json.load(data_file) ##Json file with all the ckey, csecret,…
David Yi
  • 401
  • 1
  • 6
  • 18
0
votes
0 answers

TweetStream getting timeout Ruby

I am using Ruby2 and Rails4 and added a gem 'tweetstream' and when I am running my code for more than one user then getting "timeout" tweet_client = TweetStream::Client.new tweet_client.on_reconnect do |timeout, retries| …
Vijay Chouhan
  • 4,613
  • 5
  • 29
  • 35
0
votes
1 answer

gem TweetStream change user_ids dynamically

How after this code change user_ids dynamically? TweetStream::Client.new.follow(14252, 53235) do |status| puts "#{status.text}" end For example I start TweetStream with user_ids from DB, but after that I have a new one user_id. How add a new…
Kisakov
  • 41
  • 1
  • 3
0
votes
1 answer

Tweetstream rake works in dev, but will not work on heroku

Im running rails 4, ruby 2.1.1, webbrick, heroku, Tweetstream. I have a rake file that streams Tweets and saves them to the database, it works fine in development. When I run the rake file in Heroku, it just hangs when it gets to the stream loop...…
dan987
  • 333
  • 3
  • 10
0
votes
0 answers

Obtaining twitter API timestamp from string ID

Recently downloaded a small (230k) dataset of tweets using the streamR package in R. I saved the workspace, quit R and today began trying to use the information but the time stamp in ALL of the tweets (the created_at column of the data frame that…
eflores89
  • 339
  • 2
  • 10
  • 27
0
votes
1 answer

Twitter API in C# Tweet count

I am using twitter authenticate API but i could not get above 20 tweets. any help please my code is public void findUserTwitter(string resource_url, string q) { // oauth application keys var oauth_token = "******************"; //"insert…
Zeshan Khan
  • 294
  • 2
  • 15
0
votes
1 answer

extract tweets using ruby

I need to stream tweets and store it in mongodb for processing. I have installed ruby and the mongo and tweetstream gems. I run the below code to extract tweets and store it in a collection named "users" in "tweet" database of mongodb. Here is the…
0
votes
0 answers

How to store a collection of floats in postgres?

I'm building a script that saves tweets to a postgres database using ruby/pg/ActiveRecord/TweetStream (gem). This script works fine.. ... TweetStream::Client.new.track(SEARCH_TERMS) do |t| puts "#{t.text}" attributes = { tweetid: t[:id], …
tongamite
  • 21
  • 2
0
votes
1 answer

get tweets using stream API twitter using 1.1

I found that we can use stream API to get the latest tweets based on hash tags or keywords. It says you have to keep your http connection open. I am having a doubt regarding this. Can anyone give me an example of stream API in php? And other thing…
keen
  • 3,001
  • 4
  • 34
  • 59
0
votes
1 answer

How to get twitter tweets in json form using twitter username

How to get twitter tweets in json form using twitter username. Is there any way to get latest tweets using php curl in json format.
Adnan
  • 571
  • 5
  • 15
0
votes
1 answer

Empty models in rails runner

I'm using Rails 3.2 and I would like to have a side process monitoring a TweetStream using rails runner, unfortunately my Models seem to be empty until I access them using the debugger. What would cause this? Do I need to reconnect to my database?…
Pat Marx
  • 319
  • 2
  • 12
0
votes
1 answer

how to get the tweets from the tweeter using tweetstream python

I have written this script: import tweetstream import pymongo connection = pymongo.Connection("mongodb://localhost:27017") db = connection.socialdata words = ["social media", "innovation", "cloud computing"] with…
0
votes
1 answer

Mongodb not inserting Ruby time.new consistantly on Heroku

Built a small app to grab Tweets from political candidates for the upcoming election. Using Ruby, Twitterstream, Mongodb and Heroku. The time is being inserted into the database inconsistantly. Sometimes it works, sometimes it doesn't. Is this my…
0
votes
2 answers

How to reduce my Twitter feed to my last 3-5 tweets in my Tumblr web using HTML?

As you can see in my blog, the twitter feed displays lots and lots of tweets. I need to reduce this number to just 3-5 tweets. I have posted below the HTML code but I can see any argument like "limit", "number" or something like that. The fact is…
ramiroaznar
  • 266
  • 5
  • 15
0
votes
1 answer

Using rspec to test a method on an object that's a property of an object

If I have a method like this: require 'tweetstream' # client is an instance of TweetStream::Client # twitter_ids is an array of up to 1000 integers def add_first_users_to_stream(client, twitter_ids) # Add the first 100 ids to sitestream. …
Phil Gyford
  • 13,432
  • 14
  • 81
  • 143