Skip to content

Instantly share code, notes, and snippets.

@mskutta
Created May 11, 2015 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mskutta/c577a652ed939cff1458 to your computer and use it in GitHub Desktop.
Save mskutta/c577a652ed939cff1458 to your computer and use it in GitHub Desktop.
Social Sort Manager.cs
private Dictionary<Guid, Metrics> Execute(DataResource.GaResource.GetRequest request)
{
// Retrieve data, performing paging if necessary.
var metrics = new Dictionary<Guid, Metrics>();
GaData response = null;
do
{
var startIndex = 1;
if (response != null && !string.IsNullOrEmpty(response.NextLink))
{
var uri = new Uri(response.NextLink);
var paramerters = uri.Query.Split('&');
var s = paramerters.First(i => i.Contains("start-index")).Split('=')[1];
startIndex = int.Parse(s);
}
request.StartIndex = startIndex;
response = request.Execute();
ProcessData(response, metrics);
} while (!string.IsNullOrEmpty(response.NextLink));
return metrics;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment