toot newest entry on first run
This commit is contained in:
parent
992ebe0ec4
commit
63b11121bb
|
@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.7)
|
|||
include(GNUInstallDirs)
|
||||
|
||||
project (rss2mastodon
|
||||
VERSION 0.1.2
|
||||
VERSION 0.1.3
|
||||
LANGUAGES CXX
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall")
|
||||
|
|
|
@ -32,8 +32,9 @@ Install with `make install`.
|
|||
# Usage
|
||||
|
||||
Put watchwords.json into `~/.config/rss2mastodon/`. Launch with profile name.
|
||||
In the first run nothing is tooted, only the newest entry is saved.
|
||||
In the next run only newer entries are tooted.
|
||||
In the first run only the newest entry is tooted.
|
||||
|
||||
The profile can't be named "global".
|
||||
|
||||
## Error codes
|
||||
|
||||
|
|
|
@ -181,7 +181,15 @@ int main(int argc, char *argv[])
|
|||
http_get(hostname, path, answer);
|
||||
entries = parse_website(profile, answer);
|
||||
|
||||
if (last_entry.empty())
|
||||
{
|
||||
last_entry = entries.at(1);
|
||||
config.put(profile + ".last_entry", last_entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
config.put(profile + ".last_entry", entries.front());
|
||||
}
|
||||
pt::write_json(filepath + "config.json", config);
|
||||
|
||||
bool new_content = false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user