linq-to-twitter

LinqToTwitter - IsAuthorized always returns false for ApplicationOnlyAuthorizer

混江龙づ霸主 提交于 2019-12-04 18:33:12
I have an MVC4 web application that uses LinqToTwitter to display Tweets when a user's profile page is visited, if they have a Twitter handle. For this I use ApplicationOnlyAuthorizer: var auth = new ApplicationOnlyAuthorizer { Credentials = new InMemoryCredentials { ConsumerKey = "twitterConsumerKey", ConsumerSecret = "twitterConsumerSecret" } }; auth.Authorize(); My problem is that I have found that auth.IsAuthorized always returns false, even when I have call Authorize() and am successfully able to make calls to Twitter. And also, I have found that if I call Authorize() in every call made

Extract BearerToken from LinqToTwitter IAuthorizer

让人想犯罪 __ 提交于 2019-12-02 03:56:23
问题 Hopefully a simple answer to what I think is a simple question. Is it possible to Extract the BearerToken from the IAuthorizer once I am authenticated? After using LinqToTwitter to authorize, I want to make my own API calls and I need the BearerToken to do so. Thank you for your time in advance! 回答1: I'm assuming you're talking about ApplicationOnlyAuthorizer . The demos assign to IAuthorizer , so you need to convert to ApplicationOnlyAuthorizer to expose the BearerToken , like this: await

How To Get All Tweets on Hashtag using LinqToTwitter

一曲冷凌霜 提交于 2019-11-29 10:47:18
问题 I'm trying to get all tweets(count total tweet number) belong to hashtag. My function is here, how to I use maxID and sinceID for get all tweets. What is the instead of "count"? I dont'know. if (maxid != null) { var searchResponse = await (from search in ctx.Search where search.Type == SearchType.Search && search.Query == "#karne" && search.Count == Convert.ToInt32(count) select search) .SingleOrDefaultAsync(); maxid = Convert.ToString(searchResponse.SearchMetaData.MaxID); foreach (var tweet

Twitter API application-only authentication (with linq2twitter)

寵の児 提交于 2019-11-27 03:54:16
问题 I need to implement Twitter API application-only authentication and I've searched through linq2twitter oauth samples and stackoverflow questions, but I didn't find anything helpful about it. Is it possible to implement this kind of authorization with linq2twitter and how? 回答1: Sure is. Here's an example: var auth = new ApplicationOnlyAuthorizer { CredentialStore = new InMemoryCredentialStore() { ConsumerKey = "twitterConsumerKey", ConsumerSecret = "twitterConsumerSecret" } }; await auth