More named entities, documentation update
This commit is contained in:
parent
a81a200e9f
commit
8991c656c2
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required (VERSION 3.7)
|
cmake_minimum_required (VERSION 3.7)
|
||||||
project (mastorss
|
project (mastorss
|
||||||
VERSION 0.3.1
|
VERSION 0.3.2
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
22
README.md
22
README.md
|
@ -43,16 +43,22 @@ In the first run only the newest entry is tooted.
|
||||||
|
|
||||||
The profile can't be named "global".
|
The profile can't be named "global".
|
||||||
|
|
||||||
|
## Example config file
|
||||||
|
|
||||||
|
{
|
||||||
|
"example": {
|
||||||
|
"instance": "botsin.space",
|
||||||
|
"feedurl": "https:\/\/example.com\/feed.rss",
|
||||||
|
"access_token": "123abc",
|
||||||
|
"max_size": "400",
|
||||||
|
"last_entry": "Example\n\nThis is an example.\n\nhttps:\/\/example.com\/12345.html\n\n#bot"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
## Error codes
|
## Error codes
|
||||||
|
|
||||||
| Code | Explanation |
|
Same as [mastodon-cpp](https://github.com/tastytea/mastodon-cpp/blob/master/README.md#error-codes)
|
||||||
| --------: |:------------------------------|
|
|
||||||
| 0 | No error |
|
|
||||||
| 1 | Invalid call |
|
|
||||||
| 2 | Not implemented |
|
|
||||||
| 10 | Wrong number of arguments |
|
|
||||||
| 100 - 999 | HTTP status codes |
|
|
||||||
| 65535 | Unknown exception |
|
|
||||||
|
|
||||||
If you use a debug build, you get more verbose error messages.
|
If you use a debug build, you get more verbose error messages.
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ std::uint16_t read_config(pt::ptree &config, const string &profile, string &inst
|
||||||
instance = config.get(profile + ".instance", "");
|
instance = config.get(profile + ".instance", "");
|
||||||
access_token = config.get(profile + ".access_token", "");
|
access_token = config.get(profile + ".access_token", "");
|
||||||
feedurl = config.get(profile + ".feedurl", "");
|
feedurl = config.get(profile + ".feedurl", "");
|
||||||
|
max_size = config.get(profile + ".max_size", max_size);
|
||||||
}
|
}
|
||||||
catch (std::exception &e)
|
catch (std::exception &e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,8 +53,15 @@ void unescape_html(string &str)
|
||||||
|
|
||||||
std::regex relt("<");
|
std::regex relt("<");
|
||||||
std::regex regt(">");
|
std::regex regt(">");
|
||||||
|
std::regex reamp("&");
|
||||||
|
std::regex requot(""");
|
||||||
|
std::regex reapos("'");
|
||||||
|
|
||||||
str = std::regex_replace(str, relt, "<");
|
str = std::regex_replace(str, relt, "<");
|
||||||
str = std::regex_replace(str, regt, ">");
|
str = std::regex_replace(str, regt, ">");
|
||||||
|
str = std::regex_replace(str, reamp, "&");
|
||||||
|
str = std::regex_replace(str, requot, "\"");
|
||||||
|
str = std::regex_replace(str, reapos, "\'");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<string> parse_website(const string &profile, const string &xml)
|
std::vector<string> parse_website(const string &profile, const string &xml)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user