Created
May 11, 2015 18:07
-
-
Save mskutta/c577a652ed939cff1458 to your computer and use it in GitHub Desktop.
Social Sort Manager.cs
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
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