Latest 0.0.1
Homepage https://github.com/pristap/SwiftRSS
License MIT
Platforms ios 8.0
Authors

SwiftRSS Build Status

SwiftRSS is a simple RSS parser written in Swift. This repo is a fork of AlexChesters/SwiftRSS made for CocoaPods.

Todo

  • [x] Basic RSS Support
  • [x] Handle internet dates (RFC822 & RFC3339)
  • [x] Tests with several RSS feeds (Swift official blog, WordPress, Tumblr)
  • [x] Handle Feed headers
  • [x] NSCoder compatibility
  • [x] Handle Comment link, feed and count (specific to WordPress)
  • [x] Add images helper (an array of images URL like for BlockRSSParser)
  • [x] Continuous integration

Installation

For now you can install this module manually : Copy the content of the SwiftRSS folder and add it to your project.

You can also use this project as Git submodule.

Usage

This library is pretty simple to use.
All you need to do is to create a simple NSURLRequest with the URL of your feed and then use the parseFeedForRequest() method with the callback closure to be able to use your items or handle errors properly.

let request: NSURLRequest = NSURLRequest(URL: NSURL(string: http://developer.apple.com/swift/blog/news.rss))

RSSParser.parseFeedForRequest(request, callback: { (feed, error) -> Void in
  NSLog("Feed for : (feed.title)")
  NSLog("contains : (feed.items)")
})

As results you get a RSSFeed object which contain a array of RSSItems or, if something wrong happen the NSError which will give you the error from the network call or the parsing process.

How to contribute

If you notice a bug, please open an issue with all the details and code to reproduce this issue.

If you want to contribute to the project, fix something or add a feature please fork this project, work in a seperate branch, and send a pull request.
Also please consider the following section about custom feeds and specific usecases

Custom feeds and specific usecases

This project is made to be a really simple RSS Parser for a basic news feed. You may need to parse more nodes if you want to use it with a custom feed (iTunes feed for instance).
With BlockRSSParser I used to say that this kind of usage isn’t really related to the originial philosophy of the project.

Now I think the best thing to do is to move these special use case to seperate branches.

If you want to adapt this project to a specific usecase, please fork the project, create a new branch named explicitly and send a pull request.

Credits

Maintainers :

Code review:

Special thanks to :

Licence

SwiftRSS is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "SwiftRSS",
    "version": "0.0.1",
    "summary": "an RSS parser for use in iOS applications",
    "description": "A longer description of SwiftRSS in Markdown format.nn* Think: Why did you write this? What is the focus? What does it do?n* CocoaPods will be using this to generate tags, and improve search results.n* Try to keep it short, snappy and to the point.n* Finally, don't worry about the indent, CocoaPods strips it!",
    "homepage": "https://github.com/pristap/SwiftRSS",
    "license": "MIT",
    "authors": {
        "Pristap": "[email protected]"
    },
    "social_media_url": "http://twitter.com/PristapCo",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/pristap/SwiftRSS.git",
        "tag": "0.0.1"
    },
    "source_files": [
        "Classes",
        "SwiftRSS/**/*.swift"
    ]
}

Pin It on Pinterest

Share This