Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tichise/tifeedparser
RSS Parser written in Swift
https://github.com/tichise/tifeedparser
atom cocoapods parse rss spm swift swiftpackage
Last synced: 10 days ago
JSON representation
RSS Parser written in Swift
- Host: GitHub
- URL: https://github.com/tichise/tifeedparser
- Owner: tichise
- License: other
- Created: 2016-03-17T13:56:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T13:33:51.000Z (almost 2 years ago)
- Last Synced: 2024-04-24T08:29:36.710Z (7 months ago)
- Topics: atom, cocoapods, parse, rss, spm, swift, swiftpackage
- Language: Swift
- Homepage:
- Size: 102 KB
- Stars: 18
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
#### TIFeedParser ![CocoaPods Version](https://img.shields.io/cocoapods/v/TIFeedParser.svg?style=flat) ![Platform](https://img.shields.io/cocoapods/p/TIFeedParser.svg?style=flat) ![License](https://img.shields.io/cocoapods/l/TIFeedParser.svg?style=flat)
TIFeedParser is a parser for RSS, built on Alamofire and AEXML.
TIFeedParser is a very simple RSS parser written in Swift, supporting Atom, RSS1.0 and RSS2.0. You can download it from cocoapods and use [it](http://qiita.com/tichise/items/b9f55ce924159f4ad0cd).
#### Examples
#### RSS1.0, RSS2.0
```
func loadRSS() {
let feedString:String = "https://news.google.com/news?hl=us&ned=us&ie=UTF-8&oe=UTF-8&output=rss"AF.request(.GET, feedUrlString, parameters:nil)
.response {request, response, xmlData, error in
if (xmlData == nil) {
return
}
TIFeedParser.parseRSS(xmlData, completionHandler: {(isSuccess, channel, error) -> Void in
if (isSuccess) {
// self.items = channel.items!
// self.tableView.reloadData()
} else {
if (error != nil) {
print(error?.localizedDescription)
}
}
})
}
}
```#### Atom
```
func loadAtom() {
let feedString:String = "https://news.google.com/news?ned=us&ie=UTF-8&oe=UTF-8&q=nasa&output=atom&num=3&hl=ja"
AF.request(.GET, feedUrlString, parameters:nil)
.response {request, response, xmlData, error in
if (xmlData == nil) {
return
}
TIFeedParser.parseAtom(xmlData, completionHandler: {(isSuccess, feed, error) -> Void in
if (isSuccess) {
// self.entries = feed.entries!
// self.tableView.reloadData()
} else {
if (error != nil) {
print(error?.localizedDescription)
}
}
})
}
}
```#### Installation (CocoaPods)
`pod TIFeedParser`