about summary refs log tree commit diff stats
path: root/ebooks.cpp
diff options
context:
space:
mode:
authorFeffernoose <fefferburbia@gmail.com>2013-10-08 12:48:05 -0400
committerFeffernoose <fefferburbia@gmail.com>2013-10-08 12:48:05 -0400
commite802d9978aa6302e229357d5fc692726994569e5 (patch)
tree0ea5978d82f98620e53e07c8e5851424435a92b4 /ebooks.cpp
parent13dfaa4f4939f35853091b6aa80f8288178919ee (diff)
downloadrawr-ebooks-e802d9978aa6302e229357d5fc692726994569e5.tar.gz
rawr-ebooks-e802d9978aa6302e229357d5fc692726994569e5.tar.bz2
rawr-ebooks-e802d9978aa6302e229357d5fc692726994569e5.zip
Added user-configurble delay between tweets in rawr-ebooks
Also changed default delay from 15 minutes to 1 hour
Diffstat (limited to 'ebooks.cpp')
-rw-r--r--ebooks.cpp6
1 files changed, 4 insertions, 2 deletions
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)
18{ 18{
19 srand(time(NULL)); 19 srand(time(NULL));
20 20
21 YAML::Node config = YAML::LoadFile("config.yml"); 21 YAML::Node config = YAML::LoadFile("config.yml");
22 int delay = config["corpus"].as<int>();
23
22 ifstream infile(config["corpus"].as<std::string>().c_str()); 24 ifstream infile(config["corpus"].as<std::string>().c_str());
23 string corpus; 25 string corpus;
24 string line; 26 string line;
@@ -168,7 +170,7 @@ int main(int argc, char** args)
168 printf( "\ntwitterClient:: twitCurl::statusUpdate error:\n%s\n", replyMsg.c_str() ); 170 printf( "\ntwitterClient:: twitCurl::statusUpdate error:\n%s\n", replyMsg.c_str() );
169 } 171 }
170 172
171 sleep(900); 173 sleep(delay);
172 } 174 }
173 175
174 return 0; 176 return 0;