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
| language | english_name | native_name | |
|---|---|---|---|
| af | Afrikaans | Afrikaans | |
| ar | Arabic | العربية | |
| ary | Moroccan Arabic | العربية المغربية | |
| as | Assamese | অসমীয়া | |
| az | Azerbaijani | Azərbaycan dili | |
| azb | South Azerbaijani | گؤنئی آذربایجان | |
| bel | Belarusian | Беларуская мова | |
| bg_BG | Bulgarian | Български | |
| bn_BD | Bengali (Bangladesh) | বাংলা |
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
| # get repository content | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, "https://api.github.com/repos/$this->username/$this->repository/contents/README.md"); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
| curl_setopt($ch, CURLOPT_HTTPHEADER, [ | |
| 'Accept: application/vnd.github+json', | |
| 'X-Github-Api-Version: 2022-11-28', | |
| 'Authorization: Bearer ' . $this->token, | |
| ]); | |
| curl_setopt($ch, CURLOPT_USERAGENT, 'my-user-agent'); |
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
| // Example on how to reuse options between curl requests: https://stackoverflow.com/a/28301110/1047662 | |
| #include <curl.h> | |
| #include <vector> | |
| #include <string> | |
| size_t writeCallback(char* contents, size_t size, size_t nmemb, std::string* buffer) { | |
| size_t realsize = size * nmemb; | |
| if(buffer == NULL) { | |
| return 0; | |
| } |