about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--config-example.yml3
-rw-r--r--ebooks.cpp6
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
31# Actual binary 31# Actual binary
32rawr-ebooks 32rawr-ebooks
33rawr-ebooks.exe 33rawr-ebooks.exe
34rawr-gen
35rawr-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 @@
3 username: "" 3 username: ""
4 password: "" 4 password: ""
5 consumer_key: "" 5 consumer_key: ""
6 consumer_secret: "" \ No newline at end of file 6 consumer_secret: ""
7 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)
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;