Created
June 17, 2017 12:54
-
-
Save svick/3ba2d50c159d9c400ccbf37e3fe86515 to your computer and use it in GitHub Desktop.
Get corefx-standup reactions
This file contains hidden or 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
| { | |
| "frameworks": { | |
| "net46":{ | |
| "dependencies": { | |
| "Octokit": "0.24.0" | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or 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 System.Configuration; | |
| using System.Text; | |
| using System.Net; | |
| using System.Net.Http; | |
| using Octokit; | |
| public static async Task<HttpResponseMessage> Run(HttpRequestMessage req) | |
| { | |
| var client = new GitHubClient(new ProductHeaderValue("svick-corefx-standup")); | |
| client.Credentials = new Credentials(ConfigurationManager.AppSettings["GitHubToken"]); | |
| var reactions = await client.Reaction.Issue.GetAll("dotnet", "corefx-standup-temp", 5); | |
| var response = new StringBuilder(); | |
| foreach (var x in reactions.Select((r, i) => new { i, r })) | |
| { | |
| response.AppendLine($"[{x.i}] {x.r.User.Login}:{x.r.Content}"); | |
| } | |
| return req.CreateResponse(HttpStatusCode.OK, response.ToString(), "text/plain"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment