SDFeedParser, 在iOS上,解析博客的Wordpress提要最简单和最有效的方法

分享于 

4分钟阅读

GitHub

  繁體 雙語
Objective-C parser for the JSON API plugin for Wordpress. (https://wordpress.org/plugins/json-api/)
  • 源代码名称:SDFeedParser
  • 源代码网址:http://www.github.com/sebyddd/SDFeedParser
  • SDFeedParser源代码文档
  • SDFeedParser源代码下载
  • Git URL:
    git://www.github.com/sebyddd/SDFeedParser.git
    Git Clone代码到本地:
    git clone http://www.github.com/sebyddd/SDFeedParser
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/sebyddd/SDFeedParser
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    

    SDFeedParser

    SDFeedParser - -

    用于Wordpress的JSON API ( https://wordpress.org/plugins/json-api/ ) 插件的objective-c 解析器。 最简单和最有效的方法来解析你博客的Wordpress提要。

    安装

    要安装此库,只需将'sdfeedparser'文件夹复制到项目中,然后使用以下命令导入它:

    
     #import"SDFeedParser.h"
    
    
    
    

    你还需要AFNetworking才能使用这个库。 你可以在这里找到它: https://github.com/AFNetworking/AFNetworking

    CocoaPods安装

    CocoaPods是 objective-c的依赖管理器,它自动化并简化了在项目中使用诸如SDFeedParser之类的3方库库的过程。 有关详细信息,请参阅"开始运行。"指南。

    Podfile

     platform :ios, "7.0" pod "SDFeedParser", "~> "1.0"

    :如何使用

     SDFeedParser *feedParser = [[SDFeedParser alloc]init];
     [feedParser parseURL:@"http://yourBlog.com/?json=1"success:^(NSArray *postsArray, NSInteger postsCount) {
     NSLog(@"Fetched %ld posts", postsCount);
     NSLog(@"Posts: %@", postsArray);
     }failure:^(NSError *error) {
     NSLog(@"Error: %@", error);
     }];

    可用属性

    SDPost:

     @property (nonatomic) NSInteger ID;
     @property (nonatomic) NSString *URL;
     @property (nonatomic) NSString *slug;
     @property (nonatomic) NSString *title;
     @property (nonatomic) NSString *plainTitle;
     @property (nonatomic) NSString *thumbnailURL;
     @property (nonatomic) NSString *status;
     @property (nonatomic) NSString *content;
     @property (nonatomic) NSString *plainContent;
     @property (nonatomic) NSInteger contentReadingMinutes;
     @property (nonatomic) NSString *excerpt;
     @property (nonatomic) NSString *date;
     @property (nonatomic) NSString *lastModifiedDate;
     @property (nonatomic) NSArray *categoriesArray;
     @property (nonatomic) NSArray *tagsArray;
     @property (nonatomic) NSDictionary *authorInfo;
     @property (nonatomic) NSArray *commentsArray;
     @property (nonatomic) NSInteger commentsCount;
     @property (nonatomic) NSString *commentsStatus;

    SDComment:

     @property (nonatomic) NSInteger ID;
     @property (nonatomic) NSString *name;
     @property (nonatomic) NSString *url;
     @property (nonatomic) NSString *date;
     @property (nonatomic) NSString *content;
     @property (nonatomic) NSInteger parent;

    SDCategory:

     @property (nonatomic) NSInteger ID;
     @property (nonatomic) NSString *slug;
     @property (nonatomic) NSString *title;
     @property (nonatomic) NSString *categoryDescription;
     @property (nonatomic) NSInteger parent;
     @property (nonatomic) NSInteger postsCount;

    SDTag:

     @property (nonatomic) NSInteger ID;
     @property (nonatomic) NSString *slug;
     @property (nonatomic) NSString *title;
     @property (nonatomic) NSString *tagDescription;
     @property (nonatomic) NSInteger postsCount;

    ##License

    使用是在 MIT许可协议下提供的。 有关详细信息,请参阅许可证。


    PAR  WORD  parse  Wordpress  Effect  blog  
    相关文章