-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFlickrFetcher.h
52 lines (38 loc) · 1.6 KB
/
FlickrFetcher.h
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
//
// FlickrFetcher.h
//
// Created for Stanford CS193p Fall 2013.
// Copyright 2013 Stanford University. All rights reserved.
//
#import <Foundation/Foundation.h>
// key paths to photos or places at top-level of Flickr results
#define FLICKR_RESULTS_PHOTOS @"photos.photo"
#define FLICKR_RESULTS_PLACES @"places.place"
// keys (paths) to values in a photo dictionary
#define FLICKR_PHOTO_TITLE @"title"
#define FLICKR_PHOTO_DESCRIPTION @"description._content"
#define FLICKR_PHOTO_ID @"id"
#define FLICKR_PHOTO_OWNER @"ownername"
#define FLICKR_PHOTO_UPLOAD_DATE @"dateupload" // in seconds since 1970
#define FLICKR_PHOTO_PLACE_ID @"place_id"
// keys (paths) to values in a places dictionary (from TopPlaces)
#define FLICKR_PLACE_NAME @"_content"
#define FLICKR_PLACE_ID @"place_id"
// keys applicable to all types of Flickr dictionaries
#define FLICKR_LATITUDE @"latitude"
#define FLICKR_LONGITUDE @"longitude"
#define FLICKR_TAGS @"tags"
typedef enum {
FlickrPhotoFormatSquare = 1, // thumbnail
FlickrPhotoFormatLarge = 2, // normal size
FlickrPhotoFormatOriginal = 64 // high resolution
} FlickrPhotoFormat;
@interface FlickrFetcher : NSObject
+ (NSURL *)URLforTopPlaces;
+ (NSURL *)URLforPhotosInPlace:(id)flickrPlaceId maxResults:(int)maxResults;
+ (NSURL *)URLforPhoto:(NSDictionary *)photo format:(FlickrPhotoFormat)format;
+ (NSURL *)URLforRecentGeoreferencedPhotos;
+ (NSURL *)URLforInformationAboutPlace:(id)flickrPlaceId;
+ (NSString *)extractNameOfPlace:(id)placeId fromPlaceInformation:(NSDictionary *)place;
+ (NSString *)extractRegionNameFromPlaceInformation:(NSDictionary *)placeInformation;
@end