diff options
| -rw-r--r-- | Providers/QSDeliciousAPIProvider.h | 1 | ||||
| -rw-r--r-- | Providers/QSDeliciousAPIProvider.m | 7 | ||||
| -rw-r--r-- | Providers/QSLinkdingProvider.m | 8 |
3 files changed, 0 insertions, 16 deletions
diff --git a/Providers/QSDeliciousAPIProvider.h b/Providers/QSDeliciousAPIProvider.h index 310b00b..1628c38 100644 --- a/Providers/QSDeliciousAPIProvider.h +++ b/Providers/QSDeliciousAPIProvider.h @@ -14,7 +14,6 @@ @property(nonatomic, strong) NSMutableArray *posts; -// Subclasses can override these methods - (NSString *)apiURLForSite:(SocialSite)site andHost:(NSString *)host; - (NSURL *)requestURLForSite:(SocialSite)site username:(NSString *)username diff --git a/Providers/QSDeliciousAPIProvider.m b/Providers/QSDeliciousAPIProvider.m index 03991c1..a697618 100644 --- a/Providers/QSDeliciousAPIProvider.m +++ b/Providers/QSDeliciousAPIProvider.m @@ -114,12 +114,10 @@ host:(NSString *)host includeTags:(BOOL)includeTags { - // Try cached data first NSData *data = [self cachedBookmarkDataForSite:site username:username host:host]; - // If no cached data, fetch from API if (![data length]) { NSURL *requestURL = [self requestURLForSite:site username:username @@ -147,11 +145,9 @@ return @[]; } - // Cache the data [self cacheBookmarkData:data forSite:site username:username host:host]; } - // Parse XML data NSXMLParser *postParser = [[NSXMLParser alloc] initWithData:data]; [postParser setDelegate:self]; @@ -161,13 +157,11 @@ NSMutableArray *objects = [NSMutableArray arrayWithCapacity:1]; NSMutableSet *tagSet = [NSMutableSet set]; - // Create bookmark objects for (NSDictionary *post in self.posts) { QSObject *newObject = [self objectForPost:post]; if (newObject) { [objects addObject:newObject]; - // Collect tags if requested if (includeTags) { NSString *tagString = [post objectForKey:@"tag"]; if (tagString.length > 0) { @@ -178,7 +172,6 @@ } } - // Create tag objects if requested if (includeTags) { for (NSString *tag in tagSet) { if (tag.length > 0) { diff --git a/Providers/QSLinkdingProvider.m b/Providers/QSLinkdingProvider.m index 33e82bc..32b4c16 100644 --- a/Providers/QSLinkdingProvider.m +++ b/Providers/QSLinkdingProvider.m @@ -66,12 +66,9 @@ return @[]; } - // Try cached data first NSData *data = [self cachedBookmarkDataForHost:host username:username]; - // If no cached data, fetch from API if (![data length]) { - // Construct Linkding API URL NSString *baseURL = host; if (![baseURL hasPrefix:@"http://"] && ![baseURL hasPrefix:@"https://"]) { baseURL = [NSString stringWithFormat:@"https://%@", baseURL]; @@ -114,11 +111,9 @@ return @[]; } - // Cache the data [self cacheBookmarkData:data forHost:host username:username]; } - // Parse JSON data NSError *jsonError = nil; NSDictionary *jsonResponse = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError]; @@ -137,13 +132,11 @@ NSMutableArray *objects = [NSMutableArray arrayWithCapacity:1]; NSMutableSet *tagSet = [NSMutableSet set]; - // Create bookmark objects for (NSDictionary *bookmark in results) { QSObject *newObject = [self objectForLinkdingBookmark:bookmark]; if (newObject) { [objects addObject:newObject]; - // Collect tags if requested if (includeTags) { NSArray *tags = [bookmark objectForKey:@"tag_names"]; if (tags && [tags isKindOfClass:[NSArray class]]) { @@ -153,7 +146,6 @@ } } - // Create tag objects if requested if (includeTags) { for (NSString *tag in tagSet) { if (tag.length > 0) { |