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

Commented Unassigned: Search.SearchTweets is not working with #tags [2187]

$
0
0
HI Tweetinvi,


I'm trying to get all tweets for a particular #tag & it works if that #tag is trending on twitter,but if I use a custom #tag,which has only one or two tweets,its throwing errors(Object reference not set...)?
This is my code sample:

TwitterCredentials.SetCredentials("AccessToken", ".AccessSecret","ConsumerKey","ConsumerSecret");
var tokenRateLimits = RateLimit.GetCurrentCredentialsRateLimits();
if(okenRateLimits.ApplicationRateLimitStatusLimit.Remaining>0)
{
var searchParameter = Search.GenerateSearchTweetParameter("#MYCUSTOMHASHTAG");
var tweets = Search.SearchTweets(searchParameter);// getting error here
var count=tweets.Count;
}

I've tried with twitter api & it's returning the tweets:
https://api.twitter.com/1.1/search/tweets.json?q=%23MYCUSTOMHASHTAG;



-Regards,
Vikram
Comments: ** Comment from web user: vsrathore2 **

Hello Invi,,

Further to my last message:
Code works fine sometime & get all the tweets for a particular #tag,but after querying Twitter API successfully once,next time it throws an error.
Basically I have a scheduled task where I run the code in every 5 minutes to check number of tweets for a given #tag.


-Regards,
Vikram


Viewing all articles
Browse latest Browse all 4126

Trending Articles