summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--sap.cpp28
m---------vendor/rawr-ebooks0
2 files changed, 13 insertions, 15 deletions
diff --git a/sap.cpp b/sap.cpp index 4e2f66c..56fb677 100644 --- a/sap.cpp +++ b/sap.cpp
@@ -18,6 +18,13 @@ extern "C" {
18#include <thread> 18#include <thread>
19#include <chrono> 19#include <chrono>
20 20
21/* - random frames from Spongebob (using ffmpeg)
22 * with strange text overlaid, possibly rawr'd from
23 * spongebob transcripts combined with drug trip
24 * experiences? either that or something with verb
25 * frames
26 */
27
21template <class Container> 28template <class Container>
22Container split(std::string input, std::string delimiter) 29Container split(std::string input, std::string delimiter)
23{ 30{
@@ -442,25 +449,16 @@ int main(int argc, char** argv)
442 449
443 std::cout << "Generated image." << std::endl << "Tweeting..." << std::endl; 450 std::cout << "Generated image." << std::endl << "Tweeting..." << std::endl;
444 451
445 long media_id; 452 try
446 twitter::response resp = client.uploadMedia("image/jpeg", (const char*) outputimg.data(), outputimg.length(), media_id);
447 if (resp != twitter::response::ok)
448 { 453 {
449 std::cout << "Twitter error while uploading image: " << resp << std::endl; 454 long media_id = client.uploadMedia("image/jpeg", (const char*) outputimg.data(), outputimg.length());
450 455 client.updateStatus("", {media_id});
451 break;
452 }
453 456
454 twitter::tweet tw; 457 std::cout << "Done!" << std::endl << "Waiting..." << std::endl << std::endl;
455 resp = client.updateStatus("", tw, twitter::tweet(), {media_id}); 458 } catch (const twitter::twitter_error& error)
456 if (resp != twitter::response::ok)
457 { 459 {
458 std::cout << "Twitter error while tweeting: " << resp << std::endl; 460 std::cout << "Twitter error: " << error.what() << std::endl;
459
460 break;
461 } 461 }
462
463 std::cout << "Done!" << std::endl << "Waiting..." << std::endl << std::endl;
464 462
465 break; 463 break;
466 } 464 }
diff --git a/vendor/rawr-ebooks b/vendor/rawr-ebooks
Subproject 5ce05b81520d06a78165c5c5039007c9f29d4b2 Subproject da9ff8e9d6c03167e4fbdb000aa7a421e46667a