Ios 使用MIN_时间戳和MSX_时间戳从instagram获取图像
我正在尝试在两天之间使用instagram获取图像。但我错了 我编写的代码如下:Ios 使用MIN_时间戳和MSX_时间戳从instagram获取图像,ios,objective-c,instagram,Ios,Objective C,Instagram,我正在尝试在两天之间使用instagram获取图像。但我错了 我编写的代码如下: NSString * fromDate = @"2014 Aug 14 10:00:00"; NSString * toDate = @"2014 Aug 14 14:00:00"; NSDateFormatter * dateFmt = [[NSDateFormatter alloc] init]; [dateFmt setDateFormat:@"yyyy MMM dd HH:mm:ss"]; [dateFmt
NSString * fromDate = @"2014 Aug 14 10:00:00";
NSString * toDate = @"2014 Aug 14 14:00:00";
NSDateFormatter * dateFmt = [[NSDateFormatter alloc] init];
[dateFmt setDateFormat:@"yyyy MMM dd HH:mm:ss"];
[dateFmt setTimeZone:[NSTimeZone systemTimeZone]];
NSDate * time1 = [dateFmt dateFromString:fromDate];
NSDate * time2 = [dateFmt dateFromString:toDate];
int fromInterval = [time1 timeIntervalSince1970];
int toInterval = [time2 timeIntervalSince1970];
NSLog(@"FROM %d TO %d",fromInterval,toInterval);//
NSString * urlString = [NSString stringWithFormat:@"https://api.instagram.com/v1/tags/%@/media/recent?count=33&&MIN_TIMESTAMP=%dMAX_TIMESTAMP=%d&client_id=CLIENT_ID",hashTag, fromInterval,toInterval];
NSURL *urlInstagram=[NSURL URLWithString:urlString];
NSData *data=[NSData dataWithContentsOfURL:urlInstagram];
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
NSLog(@"respionse %@",json);
但它并没有给出我所期望的结果。它只在8月16日发帖。根据他们的api页面, /tags/media/recent不接受最小时间戳或最大时间戳 一种解决方案是使用count if many和基于创建时间的过滤器获取标记图像