From e802d9978aa6302e229357d5fc692726994569e5 Mon Sep 17 00:00:00 2001 From: Feffernoose Date: Tue, 8 Oct 2013 12:48:05 -0400 Subject: Added user-configurble delay between tweets in rawr-ebooks Also changed default delay from 15 minutes to 1 hour --- .gitignore | 2 ++ config-example.yml | 3 ++- ebooks.cpp | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 024e725..ebc66d3 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ Makefile # Actual binary rawr-ebooks rawr-ebooks.exe +rawr-gen +rawr-gen.exe diff --git a/config-example.yml b/config-example.yml index a280e4c..7f93476 100644 --- a/config-example.yml +++ b/config-example.yml @@ -3,4 +3,5 @@ username: "" password: "" consumer_key: "" - consumer_secret: "" \ No newline at end of file + consumer_secret: "" + delay: 3600 \ No newline at end of file diff --git a/ebooks.cpp b/ebooks.cpp index 753ead6..2dbf5e4 100644 --- a/ebooks.cpp +++ b/ebooks.cpp @@ -18,7 +18,9 @@ int main(int argc, char** args) { srand(time(NULL)); - YAML::Node config = YAML::LoadFile("config.yml"); + YAML::Node config = YAML::LoadFile("config.yml"); + int delay = config["corpus"].as(); + ifstream infile(config["corpus"].as().c_str()); string corpus; string line; @@ -168,7 +170,7 @@ int main(int argc, char** args) printf( "\ntwitterClient:: twitCurl::statusUpdate error:\n%s\n", replyMsg.c_str() ); } - sleep(900); + sleep(delay); } return 0; -- cgit 1.4.1