AddFollow() does nothing in 4.0 and throws a TwitterException in 5.0 (Filtered Streams)
See original GitHub issueHi!
“AddTrack” works for a filtered stream, but “AddFollow” does not. All I’m trying to do is get an event when “Reuters” tweets something. Here is the repro.
- Use real credentials in Auth.SetUserCredentials()
- Start the program. Notice no tweets received (Reuters tweets every few minutes). Stop the program.
- If you uncomment the AddTrack, you’ll notice you start getting tweets for “software”. However, you still never get tweets from Reuters.
using System;
using System.Threading;
using Tweetinvi;
using Tweetinvi.Models;
namespace TweetinviTest
{
class Program
{
static void Main(string[] args)
{
ExceptionHandler.SwallowWebExceptions = false;
TweetinviConfig.CurrentThreadSettings.TweetMode = TweetMode.Extended;
Auth.SetUserCredentials("removed", "removed", "removed", "removed");
var stream = Stream.CreateFilteredStream();
//stream.AddTrack("software"); // This works!
stream.AddFollow(new UserIdentifier("Reuters")); // This does NOT work
stream.MatchingTweetReceived += (sender, args) => Console.WriteLine(args.Tweet.FullText);
stream.StartStreamMatchingAnyCondition();
Thread.Sleep(Int32.MaxValue);
}
}
}
In the latest 5.0.0 version, the below code throws the TwitterException with Message: “No filter parameters found. Expect at least one parameter: follow track locations”. Is it possible to only receive tweets from a single user like this?
using System;
using System.Threading.Tasks;
using Tweetinvi;
using Tweetinvi.Models;
namespace TweetinviTest
{
class Program
{
public static async Task Main(string[] args)
{
var credentials = new TwitterCredentials("removed", "removed", "removed", "removed");
var client = new TwitterClient(credentials);
var stream = client.Streams.CreateFilteredStream();
stream.AddFollow(new UserIdentifier("Reuters"));
stream.MatchingTweetReceived += (sender, args) => Console.WriteLine("Reuters tweet: " + args.Tweet.FullText);
await stream.StartMatchingAnyConditionAsync(); // throws TwitterException with Message "No filter parameters found. Expect at least one parameter: follow track locations"
}
}
}
Thank you!
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (5 by maintainers)
Top Results From Across the Web
java - Streams - Filter all not throwing exception
There is nothing like " filterThrowingException " in the current Stream-API. You can do only to make a decision to keep or filter...
Read more >Filtered stream disconnects every 5 minutes on nodejs
Hi, my filtered stream on an academic account suddenly started to disconnect every five minutes without throwing an error.
Read more >Filtered Stream - Filters — Tweetinvi 5.0.4 documentation
The track filters let you track the tweets containing specific keywords. .AddTrack allow you to add a track filter to your stream.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I do agree with you @gabenotgave streaming is an essential feature, and all my dev work is dependent on it.
Really hope this issue can be solved soon, @linvi. Project won’t work without it lol.