Skip to content

Instantly share code, notes, and snippets.

@CryZe
Created July 9, 2015 11:32
Show Gist options
  • Select an option

  • Save CryZe/9cae41bdde31a6e484ff to your computer and use it in GitHub Desktop.

Select an option

Save CryZe/9cae41bdde31a6e484ff to your computer and use it in GitHub Desktop.
Barney
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SpeedrunComSharp;
namespace UnverifiedBarneyRuns
{
public static class Program
{
static void Main(string[] args)
{
var client = new SpeedrunComClient();
var barney = client.Games.SearchGame("Barney");
var anyPercent = barney.Categories.First(x => x.Name == "any%");
var allRuns = client.Runs.GetRuns(gameId: barney.ID, orderBy: RunsOrdering.Status);
var verifiedRuns = anyPercent.Leaderboard.Count();
var unverifiedRuns = allRuns.TakeWhile(x => x.Status.Type == RunStatusType.New).Count();
var totalRuns = unverifiedRuns + verifiedRuns;
Console.WriteLine("Barney has {0} runs ({1} of which are unverified)", totalRuns, unverifiedRuns);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment