How to get twitter feeds from multiple users screenname using LinqToTwitter ,

REJAHREJAH Member ✭✭✭

How to get twitter feeds from multiple users screenname using LinqToTwitter .
means i want get 30 items list from 30 sceenname of single tweet from each.

here my code

public async Task InitTweetsAsync()
{

        var auth = new ApplicationOnlyAuthorizer()
        {
            CredentialStore = new InMemoryCredentialStore
            {
                // Please use this link to create a new app in Twitter
                // https://apps.twitter.com/app/new
                // so you can get ConsumerKey and ConsumerSecret
                ConsumerKey = "T**********************",
                ConsumerSecret = "*************************************",
                    },
        };

        await auth.AuthorizeAsync();

        var ctx = new TwitterContext(auth);

        var tweets = await (from tweet  in ctx.Status where tweet.Type == StatusType.Oembed
                   && tweet.ScreenName == "keboola"
                   && tweet.Count == 30
             select tweet)
            .ToListAsync();




        Tweets = (from tweet 
                  in tweets
                  select new Tweet
                  {
                      StatusID = tweet.StatusID,
                      ScreenName = tweet.User.ScreenNameResponse,
                      Text = tweet.Text,
                      ImageUrl = tweet.User.ProfileImageUrl,
                      MediaUrl = tweet?.Entities?.MediaEntities?.FirstOrDefault()?.MediaUrl
                  })
            .ToList();

      }
Sign In or Register to comment.