about summary refs log tree commit diff stats
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
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
-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;