Preview extractor for news, articles and full-texts in Swift

Overview

ReadabilityKit

Preview extractor for news, articles and full-texts in Swift


We are a development agency building phenomenal apps.




CI Status Version Carthage Compatible License Platform

Features

Extracts:

  • Title
  • Description
  • Top image
  • Top video
  • Keywords
  • Date

Usage

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
    let datePublished = data?.datePublished
})

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

CocoaPods

pod 'ReadabilityKit'

Carthage

github "exyte/ReadabilityKit"

Manually

  1. Install Ji XML parser.
  2. Download and drop all files from Sources folder in your project.

Development Environment Setup

  1. Install Carthage.
  2. Check out and build the project's dependencies:
carthage bootstrap --platform <name>

Requirements

  • iOS 10.0+ / macOS 10.12+ / tvOS 10.0+ / watchOS 3.0+

License

ReadabilityKit is available under the MIT license. See the LICENSE file for more info.

Comments
  • iOS 11, Swift 4, Xcode 9

    iOS 11, Swift 4, Xcode 9

    Just a heads up, some parsing in Readability doesn't work for iOS 11 and Swift 4. If you'd like, I can take a look into these issues and commit some changes to another branch?

    opened by HackShitUp 16
  • Date Support Added in Readability kit

    Date Support Added in Readability kit

    In one of my project i was in need to add date support in your Kit. So i worked on it and finally got it working . Now i want to help others who needs date support in your library.Please review my changes. Thank you for your Great work.Its been great working with your kit.It will be great if you add me in contributors Best Regards Jawad Ali

    opened by jwd-ali 4
  • Swift 3 Help

    Swift 3 Help

    Ji.swift and JiNode.swift are both broken in swift 3. Can't figure out how to fix them with things like "openlass", "fileprifilevate", opeoppened" etc.

    opened by kerbelda 4
  • Wrong instructions for manual installation

    Wrong instructions for manual installation

    Commit: 84cadfc2c659d0ce442e9349174f9b890bf77c70 Author: @lfarah

    It isn't enough to copy ReadabilityKit.swift into your project since we have third-party dependency to XML parser Ji.

    opened by zapletnev 4
  • Incorrect description of articles

    Incorrect description of articles

    Try to load articles "http://www.jobsnhire.com/articles/35030/20160214/need-know-cvs-health.htm" "http://www.bbc.com/news/world-asia-china-37081013"
    "http://www.bbc.com/culture/story/20160805-when-shocking-images-must-be-covered-up" "http://football.ua/germany/311510-podolski-zavershil-kareru-v-sbornojj.html"

    using code let sURL = "http://football.ua/germany/311510-podolski-zavershil-kareru-v-sbornojj.html" let articleUrl = NSURL(string: sURL)

        let parser = Readability(url: articleUrl!)
    
        let title = parser.title()
        let description = parser.description()
        let keywords = parser.keywords()
        let imageUrl = parser.topImage()
        let videoUrl = parser.topVideo()
    

    For all this articles parser.description() returns only their first paragraph.

    opened by ChristRm 3
  • cannot parse certain websites

    cannot parse certain websites

    " https://economictimes.indiatimes.com/tech/hardware/the-iphone-se-is-in-india-heres-all-we-know/not-a-flagship/slideshow/76280131.cms "

    I have implemented this pod in my project. But it seems to not parse the url's that end with ".cms".

    Simulator Screen Shot - iPhone X - 2020-06-10 at 10 00 42

    opened by Yashraj4394 2
  • iOS 10 App Transport Security

    iOS 10 App Transport Security

    In iOS 10, Apple has promised to turn off ATS for developers who want to submit to the App Store. In this scenario, what are the plans to support this?

    opened by danielrhodes 2
  • Employ asynchronous patterns

    Employ asynchronous patterns

    I would suggest that this code excise its use of dispatch semaphores to make the fundamentally asynchronous NSURLSession behave synchronously. Apple made this asynchronous for a reason.

    If a user accidentally called this from the main thread, you'd block the main thread, which results in behaviors ranging from a poor UX to an app possibly getting killed by the watchdog process. Worse, if a user called this from within their own NSURLSession completion handler (e.g. http://stackoverflow.com/q/39253599/1271826), this will deadlock their code.

    I'd also suggest that you not initiate the asynchronous method from within the init method. By convention, one should generally configure the object from within init, and then have a separate method to start the process.

    opened by robertmryan 2
  • iOS Swift: Using table view cell, image switch issue

    iOS Swift: Using table view cell, image switch issue

    first time image loads, user scrolls down and get back to a certain cell he/she saw previously. it get latest images first an the it updates to actual depending upon the content in URL

    opened by Abhishek9634 1
  • Some URLS are not parsed.

    Some URLS are not parsed.

    Some URLS are not parsed? It's either that or the URLSession request takes quite long to parse the data. Is there a way to improve its speed/performance?

    opened by HackShitUp 1
  • Twitter and Youtube not been parsed

    Twitter and Youtube not been parsed

    Hi,

    In the initial testing of this Kit, I found out that it is unable to find parse the any data from the following,

    • Twitter

    • Youtube

    Any ideas, as to what would be causing this issue, would be helpful. Thanks.

    opened by hayetech 1
Owner
Exyte
Exyte
A NEWS app which can be used to read,share and bookmark articles of various categories

Scoop A NEWS App for iOS 14 built using Swift which allow the users to read,bookmark and share news articles. Built using MVC architecture Requirement

Sai Balaji 3 Oct 12, 2022
Headline News Widget for Pock.You can display the articles fetched by rss.

Headline News Widget for Pock This is a headline news widget plugin for Pock You can display the articles fetched by rss. Demo In the demo video, the

null 11 Aug 30, 2022
Generate and Preview Passbook Passes

Note: This project is no longer being maintained. Passbook is an iOS 6 feature that manages boarding passes, movie tickets, retail coupons, & loyalty

Nomad CLI 324 Dec 21, 2022
DGPreview - Make UIKit project enable preview feature of SwiftUI

DGPreview Make UIKit project enable preview feature of SwiftUI Requirements iOS

donggyu 5 Feb 14, 2022
BCSwiftTor - Opinionated pure Swift controller for Tor, including full support for Swift 5.5 and Swift Concurrency

BCSwiftTor Opinionated pure Swift controller for Tor, including full support for

Blockchain Commons, LLC — A “not-for-profit” benefit corporation 4 Oct 6, 2022
Swift-DocC is a documentation compiler for Swift frameworks and packages aimed at making it easy to write and publish great developer documentation.

Swift-DocC is a documentation compiler for Swift frameworks and packages aimed at making it easy to write and publish great developer docum

Apple 833 Jan 3, 2023
Zip - A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip.

Zip A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip. Usage Import Zip at the top of the Swift file

Roy Marmelstein 2.3k Jan 3, 2023
Useful Swift code samples, extensions, functionalities and scripts to cherry-pick and use in your projects

SwiftyPick ?? ?? Useful Swift code samples, extensions, functionalities and scripts to cherry-pick and use in your projects. Purpose The idea behind t

Manu Herrera 19 May 12, 2022
A handy collection of Swift method and Tools to build project faster and more efficient.

SwifterKnife is a collection of Swift extension method and some tools that often use in develop project, with them you might build project faster and

李阳 4 Dec 29, 2022
TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app.

TypeStyle TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app. Featu

Eugene Belinski 31 Dec 14, 2022
Async+ for Swift provides a simple chainable interface for your async and throwing code, similar to promises and futures

Async+ for Swift provides a simple chainable interface for your async and throwing code, similar to promises and futures. Have the best of both worlds

async_plus 132 Jan 6, 2023
A lightweight extension to Swift's CollectionDifference, supporting moves in addition to removals and insertions, critical when updating interfaces and managing reference types.

DifferenceTracker is a lightweight extension to Swift's CollectionDifference. It defines moves in addition to removals and insertions, critical when updating interfaces and managing reference types.

Giles Hammond 2 Nov 25, 2022
Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

Apple 2k Dec 28, 2022
Validate iOS, Android, and Mac localizations. Find errors in .strings, .stringsdict, and strings.xml files.

Locheck An Xcode and Android localization file validator. Make sure your .strings, .stringsdict, and strings.xml files do not have any errors! What do

Asana 73 Dec 13, 2022
Customize and resize sheets in SwiftUI with SheeKit. Utilise the power of `UISheetPresentationController` and other UIKit features.

SheeKit Customize and resize sheets in SwiftUI with SheeKit. Utilise the power of UISheetPresentationController and other UIKit features. Overview She

Eugene Dudnyk 67 Dec 31, 2022
Tools and helpers to make building apps faster and safer.

The UBFoundation framework provides a set of useful tools and helpers to make building apps faster and safer.

Ubique 7 Dec 19, 2022
Paul Hudson redesigned and remastered the original MoonshotApp. And so I followed the tutorial

Moonshot App for iOS. parsing some json files, using generics, and creating multi page app. Application provides simple informations from the Apollo m

Pavel Surový 0 Dec 7, 2021
Easy CBOR encoding and decoding for iOS, macOS, tvOS and watchOS.

CBORCoding CBORCoding is a lightweight framework containing a coder pair for encoding and decoding Codable conforming types to and from CBOR document

Joe Newton 23 Nov 8, 2022