twitter-streaming-api

Twitter analytics data via Stream API using OAuth (access token)

蓝咒 提交于 2019-12-11 16:20:12
问题 I want the twitter analytics data, some values like: retweets, *followers, demographics and geographic data. I have Access Tokens for multiple users, and I want to access their data of Twitter Analytics. I have checked this thread too: C# console application Streaming API 1.1 + Oauth but my scenario is different, I don't want the data for a single user only, I have multiple users with their access tokens. How can I accomplish this task? I have seen their Rest API, it's not possible from it.

Using callbacks with Socket IO

こ雲淡風輕ζ 提交于 2019-12-11 16:17:08
问题 I'm using node and socket io to stream twitter feed to the browser, but the stream is too fast. In order to slow it down, I'm attempting to use setInterval, but it either only delays the start of the stream (without setting evenly spaced intervals between the tweets) or says that I can't use callbacks when broadcasting. Server side code below: function start(){ stream.on('tweet', function(tweet){ if(tweet.coordinates && tweet.coordinates != null){ io.sockets.emit('stream', tweet); } }); } io

IOExcpetion while connecting to Twitter Streaming API with Apache Flink

别等时光非礼了梦想. 提交于 2019-12-10 16:38:21
问题 I wrote a small Scala program which uses the Apache Flink Streaming API to read Twitter tweets. object TwitterWordCount { private val properties = "/home/twitter-login.properties" def main(args: Array[String]) { val env = StreamExecutionEnvironment.getExecutionEnvironment val twitterStream = env.addSource(new TwitterSource(properties)) val tweets = twitterStream .flatMap(new JSONParseFlatMap[String, String] { override def flatMap(in: String, out: Collector[String]): Unit = { if (getString(in,

Spark Streaming : Join Dstream batches into single output Folder

人走茶凉 提交于 2019-12-08 11:44:39
问题 I am using Spark Streaming to fetch tweets from twitter by creating a StreamingContext as : val ssc = new StreamingContext("local[3]", "TwitterFeed",Minutes(1)) and creating twitter stream as : val tweetStream = TwitterUtils.createStream(ssc, Some(new OAuthAuthorization(Util.config)),filters) then saving it as text file tweets.repartition(1).saveAsTextFiles("/tmp/spark_testing/") and the problem is that the tweets are being saved as folders based on batch time but I need all the data of each

How to keep streaming continuously - Tweetinvi

。_饼干妹妹 提交于 2019-12-07 12:54:42
问题 I adapted the following code from one I found online. Works ok but is not running continuously and pulling in new tweets. What do I need to change? Help appreciated. private static void Stream_FilteredStreamExample() { SqlConnection conn = new SqlConnection(@"Data Source=********************"); conn.Open(); for (; ; ) { try { var stream = Stream.CreateFilteredStream(); //stream.AddLocation(Geo.GenerateLocation(-180, -90, 180, 90)); stream.AddTweetLanguageFilter(Language.English); stream

Detect Tweet deletion with Twitter Streaming API

随声附和 提交于 2019-12-06 01:16:44
问题 The Twitter Streaming API can be used to detect a phrase using the following query: http://stream.twitter.com/1/statuses/filter.json?track=phrase However, the same query doesn't seem to detect when the tweet is deleted. Is there a way to do that with the API? Thanks in advance. 回答1: According to the docs, you're supposed to get deletions in the stream, they should look like this: {"delete":{"status":{"id":1234,"id_str":"1234","user_id":3,"user_id_str":"3"}}} UPDATE: I did a few tests to see

How to keep streaming continuously - Tweetinvi

ε祈祈猫儿з 提交于 2019-12-05 21:35:54
I adapted the following code from one I found online. Works ok but is not running continuously and pulling in new tweets. What do I need to change? Help appreciated. private static void Stream_FilteredStreamExample() { SqlConnection conn = new SqlConnection(@"Data Source=********************"); conn.Open(); for (; ; ) { try { var stream = Stream.CreateFilteredStream(); //stream.AddLocation(Geo.GenerateLocation(-180, -90, 180, 90)); stream.AddTweetLanguageFilter(Language.English); stream.AddTrack("#TubeStrike"); var timer = Stopwatch.StartNew(); stream.MatchingTweetReceived += (sender, args) =>

Limit tweepy stream to a specific number

核能气质少年 提交于 2019-12-05 02:33:02
问题 class listener(StreamListener): def on_status(self, status): try: userid = status.user.id_str geo = str(status.coordinates) if geo != "None": print(userid + ',' + geo) else: print("No coordinates") return True except BaseException as e: print('failed on_status,',str(e)) time.sleep(5) def on_error(self, status): print(status) auth = OAuthHandler(ckey, csecret) auth.set_access_token(atoken, asecret) twitterStream = Stream(auth, listener()) twitterStream.filter(locations=[-97.54,32.55,-97.03,33

The Requests streaming example does not work in my environment

自闭症网瘾萝莉.ら 提交于 2019-12-04 12:59:27
问题 I've been trying to consume the Twitter Streaming API using Python Requests. There's a simple example in the documentation: import requests import json r = requests.post('https://stream.twitter.com/1/statuses/filter.json', data={'track': 'requests'}, auth=('username', 'password')) for line in r.iter_lines(): if line: # filter out keep-alive new lines print json.loads(line) When I execute this, the call to requests.post() never returns. I've experimented and proved that it is definitely

Detect Tweet deletion with Twitter Streaming API

本小妞迷上赌 提交于 2019-12-04 06:55:56
The Twitter Streaming API can be used to detect a phrase using the following query: http://stream.twitter.com/1/statuses/filter.json?track=phrase However, the same query doesn't seem to detect when the tweet is deleted. Is there a way to do that with the API? Thanks in advance. According to the docs , you're supposed to get deletions in the stream, they should look like this: {"delete":{"status":{"id":1234,"id_str":"1234","user_id":3,"user_id_str":"3"}}} UPDATE: I did a few tests to see what was going on. First, I tried the filter URL with a track parameter, just like you are trying, and