linq2twitter_v3_300x90.png

LINQ to Twitter is a LINQ Provider for the Twitter micro-blogging service. It uses standard LINQ syntax for queries and includes method calls for changes via the Twitter API.

Example

You can try LINQ to Twitter, even if you don't have a twitter account. The following query returns a list of tweets from the public timeline:

            var twitterCtx = new TwitterContext();

            var publicTweets =
                from tweet in twitterCtx.Status
                where tweet.Type == StatusType.Public
                select tweet;

            publicTweets.ToList().ForEach(
                tweet => Console.WriteLine(
                    "User Name: {0}, Tweet: {1}",
                    tweet.User.Name,
                    tweet.Text));


From a coding experience perspective, the TwitterContext type is analogous to DataContext (LINQ to SQL) or ObjectContext (LINQ to Entities). You use the TwitterContext instance, twitterCtx, to access IQueryable<T> tweet categories. In the example above the Status will give you the ability to query Status tweets.

Each tweet category has a Type property for the type of tweets you want to get back. For example, Status tweets can be made for Public, Friend, or User timelines. Each tweet category has a type enum to help you figure out what is available. The example above uses StatusType.Public to get Public Status tweets.

Just like other LINQ providers, you get an IQueryable<T> back from the query. You can see how to materialize the query by invoking the ToList operator. Just like other LINQ providers, LINQ to Twitter does deferred execution, so operators such as ToList and ToArray or statements such as for and foreach loops will cause the query to execute and make the actual call to Twitter.

Collaborations

Software that LINQ to Twitter Uses:

Services, Sites, and Software that Uses LINQ to Twitter

Contact Joe Mayo if you would like to add your link to one of the collaborations categories above.

Available Feature Set

Status Query Tweets:

  • Public Timeline
  • Friend Timeline
  • User Timeline
  • Mentions Timeline

Status Methods:

  • Show
  • Update
  • Destroy

User Methods:

  • Show
  • Friends
  • Followers

Direct Message Methods:

  • Sent
  • New
  • Destroy

Friendship Methods

  • Create
  • Destroy
  • Exists

Social Graph Methods

  • Friends
  • Followers

Account Methods

  • Verify Credentials
  • Rate Limit Status
  • End Session
  • Update Delivery Device
  • Update Profile Colors
  • Update Profile Image
  • Update Profile Background Image
  • Update Profile

Favorite Methods

  • Favorites
  • Create
  • Destroy

Notification Methods

  • Follow
  • Leave

Block Methods

  • Create
  • Destroy

Help Methods

  • Test

Twitter Search

  • Search
  • Trends

Authentication

  • Basic
  • OAuth

Saved Searches

  • Search
  • Show
  • Create
  • Destroy

Platforms

  • .NET 3.5
  • C# 3.0
  • VB 9.0
  • Delphi Prism
  • Twitter
  • Laconica

What's Next

LINQ to Twitter is now at full v1.0, RTW. Future development will progress in parallel with the Twitter API. If you have any special requests or ideas for ways to use LINQ to Twitter, please visit the discussion forum on this site or contact me on Twitter.

Contributions

This is open source and is free to use. However, people occasionally inquire on how to provide compensation. I'm not taking direct financial donations but you are welcome to click on the advertisement on the right side of the page or buy/rate my books:

Additionally, Andrew Arnott has made extensive contributions to the security infrastructure of LINQ to Twitter by integrating his excellent DotNetOpenAuth library. His software includes many features including DotNetOpenID, ASP.NET controls, and more:

Joe

Last edited Jan 16 at 10:38 PM by JoeMayo, version 30

 

Want to leave feedback?
Please use Discussions or Reviews instead.

Archived page comments (1)

Updating...
© 2006-2010 Microsoft | About CodePlex | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2010.1.12.16187