1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
|
#include "ofxInstagram.h"
#include <unistd.h>
#pragma mark - Setup
//--------------------------------------------------------------
void ofxInstagram::setup(string auth_token, string clientID)
{
scrollValue = 0;
// Set the Tokens
_auth_token = auth_token;
_clientID = clientID;
}
//--------------------------------------------------------------
void ofxInstagram::setCertFileLocation(std::string path)
{
_certPath = path;
cout << _certPath << endl;
}
//--------------------------------------------------------------
void ofxInstagram::drawJSON(int x)
{
ofPushMatrix();
ofTranslate(x, scrollValue);
ofDrawBitmapString(getParsedJSONString(), 0,0);
ofPopMatrix();
}
#pragma mark - Scroll Stuff
//--------------------------------------------------------------
void ofxInstagram::mouseScroll(int scrollY)
{
scrollValue += scrollY;
}
//--------------------------------------------------------------
void ofxInstagram::resetScroll()
{
scrollValue = 0;
}
//--------------------------------------------------------------
void ofxInstagram::saveJson(string filename)
{
json.toStyledString();
json.save(filename+".json");
}
#pragma mark - User Endpoints
//--------------------------------------------------------------
// *
// * USER ENDPOINTS
// * GET Info
// * GET User Feed
// * GET User Recent Media
// * GET User Like Media
// * GET User Search Users
// *
//--------------------------------------------------------------
void ofxInstagram::getUserInformation(string who)
{
stringstream url;
url << "https://api.instagram.com/v1/users/" << who << "/?access_token=" << _auth_token;
cout << "Getting Info about User: This is your request: " << url.str() <<endl;
response = ofLoadURL(url.str());
json.parse(response.data);
}
//--------------------------------------------------------------
void ofxInstagram::getUserFeed(int count,string minID,string maxID)
{
stringstream url;
url << "https://api.instagram.com/v1/users/self/feed?access_token=" << _auth_token << "&count="<< ofToString(count);
if (minID.length() != 0) {
url << "&minID=" << minID;
}
if (maxID.length() != 0) {
url << "&maxID=" << maxID;
}
response = ofLoadURL(url.str());
cout << "Getting Users Feed: This is your request: " << url.str() <<endl;
json.parse(response.data);
_paginationID = json["pagination"]["next_max_id"].asString();
}
//--------------------------------------------------------------
void ofxInstagram::getUserRecentMedia(string who,int count,string max_timestamp,string min_timestamp,string minID,string maxID)
{
stringstream url;
url << "https://api.instagram.com/v1/users/" << who << "/media/recent?access_token=" << _auth_token << "&count="<< ofToString(count);
if (minID.length() != 0) {
url << "&minID=" << minID;
}
if (maxID.length() != 0) {
url << "&maxID=" << maxID;
}
if (min_timestamp.length() != 0) {
url << "&min_timestamp=" << min_timestamp;
}
if (max_timestamp.length() != 0) {
url << "&max_timestamp=" << max_timestamp;
}
response = ofLoadURL(url.str());
cout << response.data << endl;
cout << "Getting " << who << "'s Feed: This is your request: " << url.str() <<endl;
json.parse(response.data);
_paginationID = json["pagination"]["next_max_id"].asString();
cout << _paginationID << endl;
}
//--------------------------------------------------------------
void ofxInstagram::getUserLikedMedia(int count,string maxLikeID)
{
stringstream url;
url << "https://api.instagram.com/v1/users/self/media/liked?access_token=" << _auth_token << "&count="<< ofToString(count);
if (maxLikeID.length() != 0) {
url << "&max_like_ID=" << maxLikeID;
}
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
_paginationID = json["pagination"]["next_max_id"].asString();
}
//--------------------------------------------------------------
void ofxInstagram::getSearchUsers(string query,int count)
{
stringstream url;
url << "https://api.instagram.com/v1/users/search?access_token=" << _auth_token << "&count="<< ofToString(count);
if (query.length() != 0) {
url << "&q=" << query;
}
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
}
#pragma mark - Relationship Endpoints
//--------------------------------------------------------------
// *
// * MEDIA ENDPOINTS
// * GET who User Follows
// * GET who User is Followed By
// * GET get who User has Requested to Follow
// * GET relationship to User
// * POST change Relationship to User
// *
//--------------------------------------------------------------
void ofxInstagram::getWhoUserFollows(string who)
{
stringstream url;
url << "https://api.instagram.com/v1/users/" << who << "/follows?access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
}
//--------------------------------------------------------------
void ofxInstagram::getWhoUserIsFollowedBy(string who)
{
stringstream url;
url << "https://api.instagram.com/v1/users/" << who << "/followed-by?access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
}
//--------------------------------------------------------------
void ofxInstagram::getWhoHasRequestedToFollow(string who)
{
stringstream url;
url << "https://api.instagram.com/v1/users/" << who << "/requested-by?access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
}
//--------------------------------------------------------------
void ofxInstagram::getRelationshipToUser(string who)
{
stringstream url;
url << "https://api.instagram.com/v1/users/" << who << "/relationship?access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
}
//--------------------------------------------------------------
void ofxInstagram::changeRelationshipToUser(string who,string action)
{
//follow/unfollow/block/unblock/approve/ignore.
// TO DO
}
#pragma mark - Media Endpoints
//--------------------------------------------------------------
// *
// * MEDIA ENDPOINTS
// * GET Info about Media
// * GET Info using Shortcode
// * GET Search Media
// * GET Popular Media
// *
//--------------------------------------------------------------
void ofxInstagram::getMediaInformation(string mediaID)
{
stringstream url;
url << "https://api.instagram.com/v1/media/" << mediaID << "?access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
}
//--------------------------------------------------------------
void ofxInstagram::getMediaInfoUsingShortcode(string shortcode)
{
stringstream url;
url << "https://api.instagram.com/v1/media/shortcode/" << shortcode << "?access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
}
//--------------------------------------------------------------
void ofxInstagram::searchMedia(string lat, string lng,string min_timestamp,string max_timestamp,int distance)
{
stringstream url;
url << "https://api.instagram.com/v1/media/search?access_token=" << _auth_token;
if (lat.length() != 0) {
url << "&lat=" << lat;
}
if (lng.length() != 0) {
url << "&lng=" << lng;
}
if (min_timestamp.length() != 0) {
url << "&min_timestamp=" << min_timestamp;
}
if (max_timestamp.length() != 0) {
url << "&max_timestamp=" << max_timestamp;
}
url << "&distance=" << distance;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
_paginationID = json["pagination"]["next_max_id"].asString();
}
//--------------------------------------------------------------
void ofxInstagram::getPopularMedia()
{
stringstream url;
url << "https://api.instagram.com/v1/media/popular?access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
}
#pragma mark - Comments Endpoints
//--------------------------------------------------------------
// *
// * COMMENT ENDPOINTS
// * GET Comments on Media Object
// * POST Comment on Media Object
// * DELETE Comment on Media Object
// *
//--------------------------------------------------------------
void ofxInstagram::getCommentsForMedia(string mediaID)
{
stringstream url;
url << "https://api.instagram.com/v1/media/" << mediaID << "/comments?access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
}
//--------------------------------------------------------------
void ofxInstagram::postCommentOnMedia(string mediaID, string comment)
{
CURL *curl;
CURLcode res;
stringstream url;
url << "https://api.instagram.com/v1/media/" << mediaID << "/comments";
string acc = "access_token="+_auth_token;
static const char *token = acc.data();
static const char *comments = comment.data();
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL,url.str().data());
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, token);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(token));
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, comments);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(comments));
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);
curl_easy_setopt(curl, CURLOPT_POST,true);
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
/* always cleanup */
curl_easy_cleanup(curl);
}
}
//--------------------------------------------------------------
void ofxInstagram::deleteCommentOnMedia(string mediaID,string commentID)
{
CURL *curl;
CURLcode res;
stringstream url;
url << "https://api.instagram.com/v1/media/" << mediaID << "/comments/" << commentID << "?access_token="<<_auth_token;
const char * file = _certPath.data();
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL,url.str().data());
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST , 1L);
curl_easy_setopt(curl, CURLOPT_CAINFO, file);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST,"DELETE");
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
/* always cleanup */
curl_easy_cleanup(curl);
}
}
#pragma mark - Like Endpoints
//--------------------------------------------------------------
// *
// * LIKE ENDPOINTS
// * GET List of Likes on Media Object
// * POST Like Media
// * POST unlike Media
// *
//--------------------------------------------------------------
void ofxInstagram::getListOfUsersWhoLikedMedia(string mediaID)
{
stringstream url;
url << "https://api.instagram.com/v1/media/" << mediaID << "/likes?access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
}
//--------------------------------------------------------------
void ofxInstagram::likeMedia(string mediaID)
{
CURL *curl;
CURLcode res;
stringstream url;
url << "https://api.instagram.com/v1/media/" << mediaID << "/likes";
string acc = "access_token="+_auth_token;
static const char *token = acc.data();
const char * file = _certPath.data();
const char * chr;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL,url.str().data());
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, token);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(token));
/* SSL Options */
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER , 1L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST , 1L);
/* Provide CA Certs from http://curl.haxx.se/docs/caextract.html */
curl_easy_setopt(curl, CURLOPT_CAINFO, file);
curl_easy_setopt(curl, CURLOPT_POST,true);
/* Perform the request, ¤res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
/* always cleanup */
curl_easy_cleanup(curl);
}
}
//--------------------------------------------------------------
void ofxInstagram::unlikeMedia(string mediaID)
{
CURL *curl;
CURLcode res;
stringstream url;
url << "https://api.instagram.com/v1/media/" << mediaID << "/likes?access_token="<<_auth_token;
const char * file = _certPath.data();
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL,url.str().data());
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST , 1L);
curl_easy_setopt(curl, CURLOPT_CAINFO, file);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST,"DELETE");
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
/* always cleanup */
curl_easy_cleanup(curl);
}
}
#pragma mark - Tag Endpoints
//--------------------------------------------------------------
// *
// * TAG ENDPOINTS
// * GET Info about Tags
// * GET List of Tagged Objects
// * GET Search for Tag Objects
// *
//--------------------------------------------------------------
void ofxInstagram::getInfoForTags(string tagname)
{
stringstream url;
url << "https://api.instagram.com/v1/tags/" << tagname << "?access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
_paginationID = json["pagination"]["next_max_id"].asString();
}
//--------------------------------------------------------------
void ofxInstagram::getListOfTaggedObjectsNormal(string tagname, int count, string min_tagID,string max_tagID)
{
stringstream url;
url << "https://api.instagram.com/v1/tags/" << tagname << "/media/recent?access_token=" << _auth_token;
if (min_tagID.length() != 0) {
url << "&min_tag_id=" << min_tagID;
}
if (max_tagID.length() != 0) {
url << "&max_tag_id=" << max_tagID;
}
url << "&count=" << count;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
_paginationID = json["pagination"]["next_max_id"].asString();
}
//--------------------------------------------------------------
void ofxInstagram::getListOfTaggedObjectsPagination(string tagname, int count, string max_tagID)
{
stringstream url;
url << "https://api.instagram.com/v1/tags/" << tagname << "/media/recent?access_token=" << _auth_token;
if (max_tagID.length() != 0) {
url << "&max_tag_id=" << max_tagID;
}
url << "&count=" << count;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
_paginationID = json["pagination"]["next_max_id"].asString();
}
//--------------------------------------------------------------
void ofxInstagram::searchForTags(string query)
{
stringstream url;
url << "https://api.instagram.com/v1/tags/search?q=" << query << "&access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
_paginationID = json["pagination"]["next_max_id"].asString();
}
#pragma mark - Locations Endpoints
//--------------------------------------------------------------
// *
// * LOCATIONS ENDPOINTS
// * GET Info about Locations
// * GET Recent Media from Location
// * GET Search for Locations by LAT,LNG
// *
//--------------------------------------------------------------
void ofxInstagram::getInfoAboutLocation(string location)
{
stringstream url;
url << "https://api.instagram.com/v1/locations/" << location << "?access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
_paginationID = json["pagination"]["next_max_id"].asString();
}
//--------------------------------------------------------------
void ofxInstagram::getRecentMediaFromLocation(string location, string min_timestamp,string max_timestamp,string minID,string maxID)
{
stringstream url;
url << "https://api.instagram.com/v1/locations/" << location << "/media/recent?access_token=" << _auth_token;
if (minID.length() != 0) {
url << "&min_id=" << minID;
}
if (maxID.length() != 0) {
url << "&max_id=" << maxID;
}
if (min_timestamp.length() != 0) {
url << "&min_timestamp=" << min_timestamp;
}
if (max_timestamp.length() != 0) {
url << "&max_timestamp=" << max_timestamp;
}
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
_paginationID = json["pagination"]["next_max_id"].asString();
}
//--------------------------------------------------------------
void ofxInstagram::searchForLocations(string distance, string lat, string lng,string facebook_PlacesID,string foursquareID)
{
stringstream url;
url << "https://api.instagram.com/v1/locations/search?";
if (lat.length() != 0) {
url << "&lat=" << lat;
}
if (lng.length() != 0) {
url << "&lng=" << lng;
}
if (facebook_PlacesID.length() != 0) {
url << "&facebook_places_id=" << facebook_PlacesID;
}
if (foursquareID.length() != 0) {
url << "&foursquare_id=" << foursquareID;
}
url << "&distance=" << distance;
url << "&access_token=" << _auth_token;
response = ofLoadURL(url.str());
cout << "This is your request: " << url.str() <<endl;
json.parse(response.data);
_paginationID = json["pagination"]["next_max_id"].asString();
}
#pragma mark - Geography Endpoints
//--------------------------------------------------------------
// *
// * GEOGRAPHY ENDPOINTS
// * GET Media from Custom GeoID
// *
//--------------------------------------------------------------
void ofxInstagram::getRecentMediaFromGeoID(string geoID,int count,string minID)
{
}
#pragma mark - Get Elements
//--------------------------------------------------------------
// *
// * Get Elements
// *
//--------------------------------------------------------------
//--------------------------------------------------------------
string ofxInstagram::getParsedJSONString() const
{
if (response.data.size() == 0) {
return "";
}
else{
return ofxJSONElement(response.data).toStyledString();
}
}
//--------------------------------------------------------------
string ofxInstagram::getMaxIdForPagination()
{
return _paginationID;
}
//--------------------------------------------------------------
string ofxInstagram::getPostMessage(string message)
{
return message;
}
//--------------------------------------------------------------
string ofxInstagram::getRawJSONString() const
{
if (response.data.size() == 0) {
return "";
}
else{
return response.data.getText();
}
}
//--------------------------------------------------------------
ofxJSONElement ofxInstagram::getJSON() const
{
return json;
}
//--------------------------------------------------------------
deque <basicData> ofxInstagram::getBasicData()
{
deque <basicData> data;
data.resize(json["data"].size());
for(unsigned int i = 0; i < json["data"].size(); ++i)
{
data[i].user = json["data"][i]["user"]["username"].asString();
data[i].imageID = json["data"][i]["id"].asString();
data[i].imageURL = json["data"][i]["images"]["low_resolution"]["url"].asString();
data[i].created_at = json["data"][i]["created_time"].asString();
data[i].caption = json["data"][i]["caption"]["text"].asString();
}
return data;
}
//--------------------------------------------------------------
deque <string> ofxInstagram::getImageURL()
{
deque<string>elements;
for(unsigned int i = 0; i < json["data"].size(); ++i){
std::string title = json["data"][i]["images"]["standard_resolution"]["url"].asString();
elements.push_back(title);
}
return elements;
}
//--------------------------------------------------------------
deque <string> ofxInstagram::getImageCaption()
{
deque<string>elements;
for(unsigned int i = 0; i < json["data"].size(); ++i){
std::string caption = json["data"][i]["caption"]["text"].asString();
elements.push_back(caption);
}
return elements;
}
//--------------------------------------------------------------
deque <string> ofxInstagram::getVideoURL(){
deque<string>elements;
for(unsigned int i = 0; i < json["data"].size(); ++i){
std::string title = json["data"][i]["videos"]["standard_resolution"]["url"].asString();
elements.push_back(title);
}
return elements;
}
//--------------------------------------------------------------
deque <string> ofxInstagram::getProfilePicture(){
deque <string> elements;
for(unsigned int i = 0; i < json["data"].size(); ++i){
std::string profilePicture = json["data"][i]["user"]["profile_picture"].asString();
elements.push_back(profilePicture);
}
return elements;
}
//--------------------------------------------------------------
deque < deque <string> > ofxInstagram::getTags(){
deque < deque <string> > elements;
for(unsigned int i = 0; i < json["data"].size(); ++i){
deque <string> subelements;
for(unsigned int j = 0; j < json["data"][i]["user"]["tags"].size(); ++j){
std::string tag = json["data"][i]["user"]["tags"][j].asString();
subelements.push_back(tag);
}
elements.push_back(subelements);
}
return elements;
}
//--------------------------------------------------------------
deque <string> ofxInstagram::getImageID()
{
deque<string>elements;
for(unsigned int i = 0; i < json["data"].size(); ++i){
std::string title = json["data"][i]["caption"]["id"].asString();
elements.push_back(title);
}
return elements;
}
|