NOTE: ReadabilityKit is in maintenance mode. We recommend using SwiftLinkPreview in the new code. We will continue to provide new releases with the latest versions of Xcode.
ReadabilityKit helps you to extract a relevant preview (title, description, image and video) from the URL.
The goal is to try and get the best extraction from the article for servicing applications that need to show a preview of a web URL along with an image.
Inspired by snacktory and newspaper.
Extracts:
- Title
- Description
- Top image
- Top video
- Keywords
- iOS 8.0+ / Mac OS X 10.10+ / tvOS 9.0+ / watchOS 2.0+
let articleUrl = URL(string: "https://someurl.com/")!
Readability.parse(url: articleUrl, completion: { data in
let title = data?.title
let description = data?.description
let keywords = data?.keywords
let imageUrl = data?.topImage
let videoUrl = data?.topVideo
})
To run the example project, clone the repo, and run pod install
from the Example directory first.
To install ReadabilityKit
, simply add the following line to your Podfile
swift 4.x:
pod 'ReadabilityKit'
swift 3.2:
pod "ReadabilityKit", "0.6.0"
Legacy swift 2.3:
pod "ReadabilityKit", "0.5.4"
Legacy swift 2.2:
pod "ReadabilityKit", "0.5.2"
To integrate ReadabilityKit
into your Xcode project using Carthage, specify it in your Cartfile
swift 4.x:
github "exyte/ReadabilityKit"
swift 3.2:
github "exyte/ReadabilityKit" "0.6.0"
Legacy swift 2.3:
github "exyte/ReadabilityKit" "0.5.4"
Legacy swift 2.2:
github "exyte/ReadabilityKit" "0.5.2"
- Install Ji XML parser
- Download and drop all files from Sources folder in your project
- Congratulations!
This project is maintained by exyte. We design and build mobile and VR/AR applications.
ReadabilityKit is available under the MIT license. See the LICENSE file for more info.