linqtotwitter 6.15.0
dotnet add package linqtotwitter --version 6.15.0
NuGet\Install-Package linqtotwitter -Version 6.15.0
<PackageReference Include="linqtotwitter" Version="6.15.0" />
paket add linqtotwitter --version 6.15.0
#r "nuget: linqtotwitter, 6.15.0"
// Install linqtotwitter as a Cake Addin #addin nuget:?package=linqtotwitter&version=6.15.0 // Install linqtotwitter as a Cake Tool #tool nuget:?package=linqtotwitter&version=6.15.0
LINQ to Twitter is an open source 3rd party LINQ Provider (Twitter Library) for the Twitter micro-blogging service. It uses standard LINQ syntax for queries and includes method calls for changes via the Twitter API.
Example
The following query returns search results where people are tweeting about LINQ to Twitter:
var twitterCtx = new TwitterContext(...);
var searchResponse =
await
(from search in twitterCtx.Search
where search.Type == SearchType.Search &&
search.Query == "\"LINQ to Twitter\""
select search)
.SingleOrDefaultAsync();
if (searchResponse != null && searchResponse.Statuses != null)
searchResponse.Statuses.ForEach(tweet =>
Console.WriteLine(
"User: {0}, Tweet: {1}",
tweet.User.ScreenNameResponse,
tweet.Text));
From a coding experience perspective, the TwitterContext
type is analogous to the Entity Framework DBContext
. You use the TwitterContext
instance, twitterCtx
, to access IQueryable<T>
tweet categories. In the example above, the Search
will give you the ability to search Twitter for tweets meeting some criteria.
Note: The ellipses in the TwitterContext parameters indicates that you need to provide an authorizer with credentials, which is required. You can visit Securing Your Applications for documentation on authorizers and visit the Download page for working examples.
Each query category has a Type
property for the type of tweets you want to get back. For example, Status
tweets can be made for Home
, Mentions
, or User
timelines. Each query category also has an XxxType
enum to help you figure out what is available. The example above uses SearchType.Search
to perform searches. Another example would be Status
queries which might have StatusType.Home
as its Type
. In the case of Search
queries, Search
is the only option, but the Type
idiom is consistent accross all query categories.
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 SingleOrDefaultAsync
operator. For Search
results, you receive one Search
entity that contains information about the Search
query and the Search
entity contains a Statuses
property that is a collection of Status
entities. On other queries, you would materialize the query with ToListAsync
for multiple results. Just like other LINQ providers, LINQ to Twitter does deferred execution, so operators such as ToListAsync
and SingleOrDefaultAsync
or statements such as for
and foreach
loops will cause the query to execute and make the actual call to Twitter.
The latest version of LINQ to Twitter supports async. You can see this where the code above await's
the query, using the SingleOrDefaultAsync
operator. Commands are async also. e.g. await TweetAsync("Hello from LINQ to Twitter")
.
For more details on how LINQ to Twitter works, you can visit Making API Calls for API specific examples. The downloadable source code also contains copious examples in the projects. Just look in the Samples folder.
NuGet
In addition to being able to download from this site, you can also automatically install LINQ to Twitter into your Visual Studio projects via NuGet;
Available Feature Set
For more info:
- follow @JoeMayo for releases and related blog posts.
- follow @Linq2Twitr for more detailed project information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- System.Text.Json (>= 6.0.3)
NuGet packages (14)
Showing the top 5 NuGet packages that depend on linqtotwitter:
Package | Downloads |
---|---|
Kentico.Xperience.Libraries
The runtime assemblies for libraries and applications that use Kentico Xperience API. |
|
Kentico.Libraries
The runtime assemblies for libraries and applications that use Kentico API. |
|
LinqToTwitter.AspNet
LINQ to Twitter is a 3rd party LINQ Provider that lets you tweet and query with the Twitter API. This library has ASP.NET authorizers and SessionStateCredentialCache that you'll need for ASP.NET Core 5 applications. |
|
SyScript.Core
SyScript Core |
|
Equ.Umbraco.Bootstrap
Equ Umbraco Bootstrap |
GitHub repositories (3)
Showing the top 3 popular GitHub repositories that depend on linqtotwitter:
Repository | Stars |
---|---|
nuke-build/nuke
🏗 The AKEless Build System for C#/.NET
|
|
xamarinhq/app-conference
Pre-build conference application built with Xamarin
|
|
JoeMayo/LinqToTwitter
LINQ Provider for the Twitter API (C# Twitter Library)
|
Version | Downloads | Last updated |
---|---|---|
6.15.0 | 166,019 | 6/29/2022 |
6.14.0 | 27,232 | 2/7/2022 |
6.12.0 | 1,589 | 2/1/2022 |
6.11.0 | 8,318 | 1/24/2022 |
6.10.0 | 3,705 | 12/28/2021 |
6.9.0 | 16,202 | 10/26/2021 |
6.8.0 | 6,928 | 9/21/2021 |
6.7.1 | 6,358 | 6/24/2021 |
6.7.0 | 1,223 | 6/24/2021 |
6.6.0 | 42,033 | 4/8/2021 |
6.5.0 | 2,031 | 2/24/2021 |
6.4.0 | 8,151 | 1/19/2021 |
6.3.0 | 1,961 | 12/28/2020 |
6.2.1 | 1,096 | 12/21/2020 |
6.2.0 | 1,413 | 12/21/2020 |
6.1.0 | 1,755 | 11/30/2020 |
6.0.0 | 2,513 | 11/11/2020 |
5.1.3 | 129,640 | 8/30/2020 |
5.1.2 | 22,567 | 4/28/2020 |
5.1.1 | 16,089 | 4/17/2020 |
5.1.0 | 10,717 | 4/14/2020 |
5.0.0 | 652,660 | 9/24/2018 |
5.0.0-beta3 | 4,404 | 6/3/2018 |
5.0.0-beta2 | 14,422 | 3/21/2018 |
5.0.0-beta1 | 9,045 | 12/25/2017 |
4.2.1 | 88,955 | 12/21/2017 |
4.2.0 | 3,535 | 12/18/2017 |
4.2.0-beta3 | 1,602 | 12/13/2017 |
4.2.0-beta2 | 63,314 | 1/16/2017 |
4.2.0-beta1 | 1,650 | 1/10/2017 |
4.1.0 | 384,998 | 2/21/2016 |
4.0.0 | 1,077,285 | 2/15/2016 |
4.0.0-beta2 | 3,431 | 11/9/2015 |
4.0.0-beta1 | 2,306 | 7/27/2015 |
3.1.2 | 159,710 | 2/5/2015 |
3.1.1 | 15,777 | 11/24/2014 |
3.1.0 | 5,403 | 10/31/2014 |
3.0.5 | 5,591 | 10/13/2014 |
3.0.4 | 85,438 | 6/16/2014 |
3.0.3 | 6,589 | 5/19/2014 |
3.0.2 | 55,092 | 2/3/2014 |
3.0.1-beta3 | 2,318 | 1/8/2014 |
2.1.11 | 63,829 | 11/26/2013 |
2.1.10 | 67,331 | 10/22/2013 |
2.1.9 | 5,054 | 10/15/2013 |
2.1.8 | 18,405 | 7/23/2013 |
2.1.7 | 4,482 | 7/9/2013 |
2.1.6 | 43,059 | 6/10/2013 |
2.1.5 | 8,524 | 4/8/2013 |
2.1.4 | 6,045 | 3/15/2013 |
2.1.3 | 21,081 | 1/2/2013 |
2.1.2 | 35,852 | 11/6/2012 |
2.1.1 | 10,559 | 9/20/2012 |
2.0.29 | 3,496 | 8/22/2012 |
2.0.28 | 7,944 | 7/15/2012 |
2.0.27 | 3,117 | 6/15/2012 |
2.0.26 | 2,732 | 6/7/2012 |
2.0.25 | 2,974 | 5/14/2012 |
2.0.24 | 3,400 | 4/11/2012 |
2.0.23 | 5,487 | 1/24/2012 |
2.0.22 | 3,235 | 11/30/2011 |
2.0.21 | 8,529 | 7/11/2011 |
2.0.20 | 5,080 | 3/15/2011 |
- Upgraded to .NET 6 (Thanks Adam Swanson)
- Updated Issue/General Templates (Thanks Jaap)
- Updated license to MIT
- Implements Bookmarks
- Supports Quote Tweets
- Includes Reverse Chronological Timelines
- Adds polls to Tweet Include Responses
- Supports NewestID and OldestID in TweetMeta
- Improved error message handling
- Updated Raw Queries to use Twitter API v2 Base URL
- Supports ID on TweetEntityMention
- Fixed PlaceField.CountryCode spelling
- Added error handling for new JSON format on duplicate tweets
- Added subscriber_count and other fields to Space queries
- Implemented Search Sort Order