Created
February 22, 2015 21:32
-
-
Save emgarten/8d8f6883786e90ecf848 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NuGet.Client; | |
using NuGet.Client.VisualStudio; | |
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication8 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var task = SearchTest(); | |
task.Wait(); | |
} | |
private static async Task SearchTest() | |
{ | |
// Using NuGet.Protocol.V2V3 3.0.0-pre-20150220053309 | |
string url = "http://nuget.org/api/v2"; | |
var repo = RepositoryFactory.Create(url); | |
var latest = await repo.GetResourceAsync<SearchLatestResource>(); | |
var results = await latest.Search("bootstrap", new SearchFilter(), 0, 1000, CancellationToken.None); | |
foreach (var result in results) | |
{ | |
Console.WriteLine(result.Title); | |
} | |
// From fiddler: | |
//www.nuget.org /api/v2/Search()?$filter=IsLatestVersion&$skip=0&$top=1000&searchTerm='bootstrap'&targetFramework=''&includePrerelease=false 53,944 no-cache application/atom+xml;type=feed;charset=utf-8 consoleapplication8.vshost:8440 | |
//www.nuget.org /api/v2/Search?searchTerm='bootstrap'&targetFramework=''&includePrerelease=false&$filter=IsLatestVersion&$top=900&$skiptoken='angular-bootstrap-switch','0.3.0' 53,947 no-cache application/atom+xml;type=feed;charset=utf-8 consoleapplication8.vshost:8440 | |
//www.nuget.org /api/v2/Search?searchTerm='bootstrap'&targetFramework=''&includePrerelease=false&$filter=IsLatestVersion&$top=800&$skiptoken='angular-bootstrap-switch','0.3.0' 53,944 no-cache application/atom+xml;type=feed;charset=utf-8 consoleapplication8.vshost:8440 | |
//www.nuget.org /api/v2/Search?searchTerm='bootstrap'&targetFramework=''&includePrerelease=false&$filter=IsLatestVersion&$top=700&$skiptoken='angular-bootstrap-switch','0.3.0' 53,944 no-cache application/atom+xml;type=feed;charset=utf-8 consoleapplication8.vshost:8440 | |
//www.nuget.org /api/v2/Search?searchTerm='bootstrap'&targetFramework=''&includePrerelease=false&$filter=IsLatestVersion&$top=600&$skiptoken='angular-bootstrap-switch','0.3.0' 53,943 no-cache application/atom+xml;type=feed;charset=utf-8 consoleapplication8.vshost:8440 | |
//www.nuget.org /api/v2/Search?searchTerm='bootstrap'&targetFramework=''&includePrerelease=false&$filter=IsLatestVersion&$top=500&$skiptoken='angular-bootstrap-switch','0.3.0' 53,943 no-cache application/atom+xml;type=feed;charset=utf-8 consoleapplication8.vshost:8440 | |
//www.nuget.org /api/v2/Search?searchTerm='bootstrap'&targetFramework=''&includePrerelease=false&$filter=IsLatestVersion&$top=400&$skiptoken='angular-bootstrap-switch','0.3.0' 53,943 no-cache application/atom+xml;type=feed;charset=utf-8 consoleapplication8.vshost:8440 | |
//www.nuget.org /api/v2/Search?searchTerm='bootstrap'&targetFramework=''&includePrerelease=false&$filter=IsLatestVersion&$top=300&$skiptoken='angular-bootstrap-switch','0.3.0' 53,941 no-cache application/atom+xml;type=feed;charset=utf-8 consoleapplication8.vshost:8440 | |
//www.nuget.org /api/v2/Search?searchTerm='bootstrap'&targetFramework=''&includePrerelease=false&$filter=IsLatestVersion&$top=200&$skiptoken='angular-bootstrap-switch','0.3.0' 53,942 no-cache application/atom+xml;type=feed;charset=utf-8 consoleapplication8.vshost:8440 | |
//www.nuget.org /api/v2/Search?searchTerm='bootstrap'&targetFramework=''&includePrerelease=false&$filter=IsLatestVersion&$top=100&$skiptoken='angular-bootstrap-switch','0.3.0' 53,843 no-cache application/atom+xml;type=feed;charset=utf-8 consoleapplication8.vshost:8440 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment