Git Product home page Git Product logo

blockrssparser's Introduction

Block RSS Parser Build Status

This is a simple AFNetworking and block based RSS parser.

Block RSS Parser is now compatible with AFNetworking 2.x.

Memory management

BlockRSSParser now require ARC. If you need to use it without ARC, please use the 1.0 tag.

AFNetworking 1.x compatibility

Please use the 1.1 version (Podspec and git tag)

Get started

Use CocoaPods! Just add this line to you Podfile:

pod 'BlockRSSParser', '~> 2.1'

If you don't want to use CocoaPods, follow theses instructions for a manual install :

  1. Drag and drop the 4 files related to the parser:

    -RSSParser.h

    -RSSParser.m

    -RSSItem.h

    -RSSItem.m

  2. You also need to add AFNetworking to your project

  3. Include the two headers RSSParser.h and RSSItem.h where you need it

  4. And than just use it this way:

 NSURLRequest *req = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://blog.lelevier.fr/rss"]];
    [RSSParser parseRSSFeedForRequest:req success:^(NSArray *feedItems) {
    	
    	//you get an array of RSSItem
    	
    } failure:^(NSError *error) {
    	
    	//something went wrong

    }];

The RSS Item:

With this parser you can get most of the informations provided by an RSS feed:

@property (strong,nonatomic) NSString *title;
@property (strong,nonatomic) NSString *itemDescripition;
@property (strong,nonatomic) NSString *content;
@property (strong,nonatomic) NSURL *link;
@property (strong,nonatomic) NSURL *commentsLink;
@property (strong,nonatomic) NSURL *commentsFeed;
@property (strong,nonatomic) NSNumber *commentsCount;
@property (strong,nonatomic) NSDate *pubDate;
@property (strong,nonatomic) NSString *author;
@property (strong,nonatomic) NSString *guid;

-(NSArray *)imagesFromItemDescription;
-(NSArray *)imagesFromContent;

note: take a look at the "RSS Standards" part

Using the sample project

The sample project is here to provide you a quick way to see how to get started. You can use CocoaPods to download the dependencies. Go to the sample project folder and run:

pod install

and

open RSSParser_Sample.xcworkspace

RSS Standards

RSS is one of the worst protocol in the world. There is many standard to describe an RSS feed and most of them are outdated.

This parser is optimised to work with a Wordpress feed and some informations like the content or the comments informations will not be present with some other providers.

The sample code use a Tumblr feed provided for my personal blog. The content is empty but the full body of the article is present in the itemDescription (description in the feed) of the feed.

TODO

-Testing => In Progress

-Documentation

-Feed header data

License

Like AFNetworking, this parser is available under the MIT license.

blockrssparser's People

Contributors

acburk avatar esasse avatar fabiopelosin avatar ogoldfinger avatar paulb00th avatar tibo avatar wzs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blockrssparser's Issues

Update Cocoapod

I forked the project to add NSCoding to it, only to find when I checked out HEAD it had already been added. I pointed cocoapods at HEAD and everything is peachy now, but an updated cocoapod will probably save others the same experience.

I would make a pull request, but I'm not sure it's possible to include tags in a PR...? If it is, it's beyond my git-fu ๐Ÿ‘Š.

Awesome class, it's been a total timesaver ๐Ÿ˜„

displaying date in UITableViewCell

cell.pubDateLabel.text = [NSString stringWithFormat:@"%@", [item pubDate]];

unfortunatley the date shows up as ((NULL))

in the rss feed I am parsing, date shows up as:

< pubDate > Fri, 7 Dec 2012< /pubDate >

How can I resolve this issue, thanks!

AFNetwork 2.x compatibility

Will you add AFNetwork 2.x compatibility in the near future?

The subclassed AFXMLRequestOperation is no longer in the library.

xmlParseCharRef: invalid xmlChar value 11

Hello,

My RSS url is http://www.cch.org.tw/rss.aspx?type=m
when use browser to open it.
It displays

This page contains the following errors:
error on line 32 at column 633: xmlParseCharRef: invalid xmlChar value 11
Below is a rendering of the page up to the first error.

Then use RSSParser to parse the url.
It just hang and not return any error.

Please help to check this issue.

Thanks.

How to access imagesFromContent

I understand how to access an RSSItem object as returned by this block:

[RSSParser parseRSSFeedForRequest:req success:^(NSArray *feedItems) {
 RSSItem *item = ...;
}]

...but I'm not sure how I can use these arrays:
-(NSArray *)imagesFromItemDescription;
-(NSArray *)imagesFromContent;

How do I get access to the images (or paths to images... not sure) in those arrays? They aren't part of the RSSItem object.

Thanks!

The sample projects URL 404s.

This link does not exist, but is set as the RequestURL in the sample project. You may want to change that to avoid confusion in the future.

Nice project by the way.

Incorrect parcing of <description> tag begins with <![CDATA[

Hello,
I've found problem with parcing of tag when bdy text begins with <![CDATA[
In this case <![CDATA[ tag was removed, but all other HTML tags still in text.
Example can see here http://www.ixbt.com/export/articles.rss (sorry for russian language)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.