/Source/externals/GData/Source/Clients/Blogger/GDataServiceGoogleBlogger.m

http://google-email-uploader-mac.googlecode.com/ · Objective C · 107 lines · 49 code · 25 blank · 33 comment · 1 complexity · 7a00ffd2e3b0c9b89884ca592da8a4ee MD5 · raw file

  1. /* Copyright (c) 2009 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. //
  16. // GDataServiceGoogleBlogger.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_BLOGGER_SERVICE
  19. #import "GDataServiceGoogleBlogger.h"
  20. #import "GDataBloggerConstants.h" // for namespaces
  21. @implementation GDataServiceGoogleBlogger
  22. + (NSURL *)blogFeedURLForUserID:(NSString *)userID {
  23. NSString *encodedUserID = [GDataUtilities stringByURLEncodingForURI:userID];
  24. NSString *const templateStr = @"%@%@/blogs";
  25. NSString *rootURLStr = [self serviceRootURLString];
  26. NSString *urlString = [NSString stringWithFormat:templateStr,
  27. rootURLStr, encodedUserID];
  28. return [NSURL URLWithString:urlString];
  29. }
  30. #pragma mark -
  31. // warn the user off of the wrong method calls
  32. - (GDataServiceTicket *)fetchFeedWithURL:(NSURL *)feedURL
  33. delegate:(id)delegate
  34. didFinishSelector:(SEL)finishedSelector {
  35. // this service does not provide "kind" elements so cannot support
  36. // automatic class determination
  37. //
  38. // call fetchFeedWithURL:feedClass: instead, specifying the expected class
  39. // for the feed
  40. GDATA_DEBUG_LOG(@"GDataServiceGoogleBlogger: use fetchFeedWithURL:feedClass:");
  41. [self doesNotRecognizeSelector:_cmd];
  42. return nil;
  43. }
  44. - (GDataServiceTicket *)fetchEntryWithURL:(NSURL *)entryURL
  45. delegate:(id)delegate
  46. didFinishSelector:(SEL)finishedSelector {
  47. // this service does not provide "kind" elements so cannot support
  48. // automatic class determination
  49. //
  50. // call fetchEntryWithURL:entryClass: instead, specifying the expected class
  51. // of the entry
  52. GDATA_DEBUG_LOG(@"GDataServiceGoogleBlogger: use fetchEntryWithURL:entryClass:");
  53. [self doesNotRecognizeSelector:_cmd];
  54. return nil;
  55. }
  56. - (GDataServiceTicket *)fetchFeedWithQuery:(GDataQuery *)query
  57. delegate:(id)delegate
  58. didFinishSelector:(SEL)finishedSelector {
  59. // this service does not provide "kind" elements so cannot support
  60. // automatic class determination
  61. //
  62. // call fetchFeedWithQuery:feedClass: instead, specifying the expected class
  63. // of the feed
  64. GDATA_DEBUG_LOG(@"GDataServiceGoogleBlogger: use fetchFeedWithQuery:feedClass:");
  65. [self doesNotRecognizeSelector:_cmd];
  66. return nil;
  67. }
  68. #pragma mark -
  69. + (NSString *)serviceID {
  70. return @"blogger";
  71. }
  72. + (NSString *)serviceRootURLString {
  73. return @"https://www.blogger.com/feeds/";
  74. }
  75. + (NSString *)defaultServiceVersion {
  76. return kGDataBloggerDefaultServiceVersion;
  77. }
  78. + (NSDictionary *)standardServiceNamespaces {
  79. return [GDataBloggerConstants bloggerNamespaces];
  80. }
  81. @end
  82. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_BLOGGER_SERVICE