| 56 | } |
| 57 | |
| 58 | std::map<std::string, std::int64_t> FSecure::GithubApi::ListChannels() |
| 59 | { |
| 60 | std::map<std::string, std::int64_t> channelMap; |
| 61 | std::string url = OBF("https://api.github.com/user/repos"); |
| 62 | |
| 63 | json response = SendJsonRequest(url, NULL, Method::GET); |
| 64 | |
| 65 | for (auto& channel : response) |
| 66 | { |
| 67 | std::string channelName = channel[OBF("name")]; |
| 68 | |
| 69 | std::int64_t cId = channel[OBF("id")]; |
| 70 | |
| 71 | channelMap.insert({ channelName, cId }); |
| 72 | } |
| 73 | |
| 74 | return channelMap; |
| 75 | } |
| 76 | |
| 77 | std::string FSecure::GithubApi::CreateChannel(std::string const& channelName) |
| 78 | { |