diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-03-25 18:02:37 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-03-25 18:02:37 -0400 |
commit | 17935c22d4f70260182e1b8a2a0be1e686fb79e3 (patch) | |
tree | 78fb5f8dbcc65f674b7b2505ffc3ad4044e78a69 /manifesto.cpp | |
parent | 3b34a9de8866f6f05b8bfe359b24f30301a7ecd0 (diff) | |
download | manifesto-17935c22d4f70260182e1b8a2a0be1e686fb79e3.tar.gz manifesto-17935c22d4f70260182e1b8a2a0be1e686fb79e3.tar.bz2 manifesto-17935c22d4f70260182e1b8a2a0be1e686fb79e3.zip |
Whitespace changes
Diffstat (limited to 'manifesto.cpp')
-rw-r--r-- | manifesto.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/manifesto.cpp b/manifesto.cpp index b81c66a..3c440c3 100644 --- a/manifesto.cpp +++ b/manifesto.cpp | |||
@@ -15,26 +15,26 @@ int main(int argc, char** argv) | |||
15 | 15 | ||
16 | std::string configfile(argv[1]); | 16 | std::string configfile(argv[1]); |
17 | YAML::Node config = YAML::LoadFile(configfile); | 17 | YAML::Node config = YAML::LoadFile(configfile); |
18 | 18 | ||
19 | twitter::auth auth; | 19 | twitter::auth auth; |
20 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); | 20 | auth.setConsumerKey(config["consumer_key"].as<std::string>()); |
21 | auth.setConsumerSecret(config["consumer_secret"].as<std::string>()); | 21 | auth.setConsumerSecret(config["consumer_secret"].as<std::string>()); |
22 | auth.setAccessKey(config["access_key"].as<std::string>()); | 22 | auth.setAccessKey(config["access_key"].as<std::string>()); |
23 | auth.setAccessSecret(config["access_secret"].as<std::string>()); | 23 | auth.setAccessSecret(config["access_secret"].as<std::string>()); |
24 | 24 | ||
25 | twitter::client client(auth); | 25 | twitter::client client(auth); |
26 | 26 | ||
27 | long loc = 0; | 27 | long loc = 0; |
28 | if (config["current_location"]) | 28 | if (config["current_location"]) |
29 | { | 29 | { |
30 | loc = config["current_location"].as<long>(); | 30 | loc = config["current_location"].as<long>(); |
31 | } | 31 | } |
32 | 32 | ||
33 | std::list<std::string> tweets; | 33 | std::list<std::string> tweets; |
34 | { | 34 | { |
35 | std::ifstream corpus(config["corpus"].as<std::string>()); | 35 | std::ifstream corpus(config["corpus"].as<std::string>()); |
36 | corpus.ignore(loc); | 36 | corpus.ignore(loc); |
37 | 37 | ||
38 | char buffer[140]; | 38 | char buffer[140]; |
39 | while (corpus) | 39 | while (corpus) |
40 | { | 40 | { |
@@ -42,14 +42,14 @@ int main(int argc, char** argv) | |||
42 | tweets.push_back(std::string(buffer, 140)); | 42 | tweets.push_back(std::string(buffer, 140)); |
43 | } | 43 | } |
44 | } | 44 | } |
45 | 45 | ||
46 | while (!tweets.empty()) | 46 | while (!tweets.empty()) |
47 | { | 47 | { |
48 | try | 48 | try |
49 | { | 49 | { |
50 | std::string nextTweet = tweets.front(); | 50 | std::string nextTweet = tweets.front(); |
51 | client.updateStatus(nextTweet); | 51 | client.updateStatus(nextTweet); |
52 | 52 | ||
53 | std::cout << "Tweeted!" << std::endl; | 53 | std::cout << "Tweeted!" << std::endl; |
54 | 54 | ||
55 | loc += 140; | 55 | loc += 140; |
@@ -64,9 +64,9 @@ int main(int argc, char** argv) | |||
64 | { | 64 | { |
65 | std::cout << "Twitter error: " << e.what() << std::endl; | 65 | std::cout << "Twitter error: " << e.what() << std::endl; |
66 | } | 66 | } |
67 | 67 | ||
68 | std::cout << "Waiting..." << std::endl; | 68 | std::cout << "Waiting..." << std::endl; |
69 | 69 | ||
70 | std::this_thread::sleep_for(std::chrono::hours(6)); | 70 | std::this_thread::sleep_for(std::chrono::hours(6)); |
71 | } | 71 | } |
72 | } | 72 | } |