From 2a6b5328dec0ef2200bdbb94b16e8531c7c071b2 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 10 Mar 2014 12:40:45 +0000 Subject: getting images from instagram --- json-instagram/src/exampleApp.cpp | 55 +++++++++++++++++++++++++++++++++++++++ json-instagram/src/exampleApp.h | 15 +++++++++++ json-instagram/src/main.cpp | 6 +++++ 3 files changed, 76 insertions(+) create mode 100644 json-instagram/src/exampleApp.cpp create mode 100644 json-instagram/src/exampleApp.h create mode 100644 json-instagram/src/main.cpp (limited to 'json-instagram/src') diff --git a/json-instagram/src/exampleApp.cpp b/json-instagram/src/exampleApp.cpp new file mode 100644 index 0000000..0559dce --- /dev/null +++ b/json-instagram/src/exampleApp.cpp @@ -0,0 +1,55 @@ +#include "exampleApp.h" + +/* +so far so good, NOW + +threading + +parse response and identify new pictures +save pictures & metadata - rather than reloading each time? +local images format +do we need any metadata? I guess not other than to know the tag id +could save with the tag id as the name of file, simpler + +how exactly do we parse or mipmap the images +do we worry about memory - I guess not + +*/ + +//------------------------------------------------------------------------------ +void exampleApp::setup() +{ + ofSetFrameRate(24); + + std::string url = "https://api.instagram.com/v1/tags/tycleeson/media/recent?client_id=c1d74d701fdf4ddd9f8d30ee9e8f944b"; + + if (!response.open(url)) { + cout << "Failed to parse JSON\n" << endl; + } + //else cout< images; +}; diff --git a/json-instagram/src/main.cpp b/json-instagram/src/main.cpp new file mode 100644 index 0000000..1c07795 --- /dev/null +++ b/json-instagram/src/main.cpp @@ -0,0 +1,6 @@ +#include "exampleApp.h" + +int main() { + ofSetupOpenGL(800,700,OF_WINDOW); + ofRunApp(new exampleApp()); +} -- cgit v1.2.3