Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: Streaming with Location AND ((track 1) OR (track 2)), possible?

$
0
0
Hi,

I am trying to capture some tweets from a region and at the same time, I would like to have at least two tracks with an OR between them like this
        var topLeft = Geo.GenerateCoordinates(..., ...);
        var bottomRight = Geo.GenerateCoordinates(..., ...);

        StreamWriter sw = new StreamWriter(outputStreamFile);
        var filteredStream = Tweetinvi.Stream.CreateFilteredStream();
        filteredStream.AddTrack("query term 1");
        filteredStream.AddTrack("query term 2");
        filteredStream.AddLocation(topLeft, bottomRight);

        filteredStream.MatchingTweetReceived += (sender, args) =>
                    {
                        Console.WriteLine(getTweetJSONObject(args.Tweet));
                        sw.WriteLine(getTweetJSONObject(args.Tweet));

                        sw.Flush();
                    };
        filteredStream.StartStreamMatchingAllConditionsAsync();
    }
However, it seems like I only have two options:

1- StartStreamMatchingAllConditionsAsync: which includes Location with AND between tracks.
2- StartStreamMatchingAnyConditionAsync: which has OR between tracks; however, it may or may not consider Location because it is part of the Any conditions instead of being treated separately.

I have tried MatchingTweetAndLocationReceived as well and seen the same behaviour.

Any ideas?

Thanks,

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>