
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.
ExampleYou 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:
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:
User Methods:
Direct Message Methods:
Friendship Methods
Social Graph Methods
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
Notification Methods
Block Methods
Help Methods
Twitter Search
Authentication
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.
This is open source and is free to use. However, if you wanted to provide compensation, I've written books that you can buy:
Joe