public async Task PublishToGitAsync(string json)
{
var credentials = new Credentials(ConfigurationManager.AppSettings["github_access_token"]);
var connection = new Connection(new ProductHeaderValue("aptitud.github.io"))
{
Credentials = credentials
};
var client = new GitHubClient(connection);
var contents = await client.Repository.Content.GetAllContents("aptitud", "aptitud.github.io", "instagram.json");
if (JsonIsSame(contents, json))
return;
string fileSha = contents.First().Sha;
await client.Repository.Content.UpdateFile(
"aptitud",
"aptitud.github.io",
"instagram.json",
new UpdateFileRequest("Update", json, fileSha));
}