JauzziParser
一个用 Swift 编写的 RSS 源解析器。
需求
安装
CocoaPods
CocoaPods 是 Swift 和 Objective-C Cocoa 项目的依赖管理器。你可以使用以下命令安装它
$ gem install cocoapods
要将 JauzziParser
集成到你的 Xcode 项目中,在 Podfile
中指定它
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
use_frameworks!
target 'MyApp' do
pod 'JauzziParser'
end
然后,运行以下命令
$ pod install
使用
import JauzziParser
JauzziParser.sharedInstance.fetchRss(url: "https://senalesdelfin.com/rss/") { [weak self] entries in
print(entries)
}
入口模型
for entry:JEntry in entries {
print(entry.link) // The entry url as a string
print(entry.title) // The entry title as a string
print(entry.description) // The entry summary/snippet as a string
print(entry.pubDate) // The entry published date as a string
print(entry.publishedDate) // Then entry published date as a Date
print(entry.categories) // The entry's categories tag as an array of strings [String]
print(entry.mediaContent) // The entry's hero image as a string url
}
许可
JauzziParser 依照 MIT 许可证发布。更多详情请见 LICENSE。