KtRssReader is a Kotlin library for parsing RSS feed.

Overview

KtRssReader

License Android Weekly Android Arsenal

KtRssReader is a Kotlin library for parsing RSS feed.

Features

Android

  • Supports RSS 2.0 standard, iTunes, and Google Play tags
  • Easy-to-use API
  • Fetches feed for you
  • Database cache and custom cache valid time
  • Customizes output data with annotations

Kotlin

  • Supports RSS 2.0 standard, iTunes, and Google Play tags
  • Easy-to-use API
  • Customizes output data with annotations

How to Use KtRssReader?

Please check out documentation for more information.

Android

Kotlin

Contribution

Contributions are always welcome. If you have any ideas or suggestions, you can contact us or create a Github issue. We will get to you as soon as possible.

Roadmap

  • Add pure Kotlin parsers.
  • Implement an annotation processor to generate custom Kotlin parsers.
  • Use KSP to speed up the annotation processor.

License

Copyright 2020 Feng Hsien Hsu, Siao Syuan Yang, Wei-Qi Wang, Ya-Han Tsai, Yu Hao Wu

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Info about contact

    Info about contact

    How can I contact someone, I have problem with custom data and reader. My reader for my data class isn't generated but I don't know why. If you have advice or can help I would appreciate that.

    opened by anovinc 4
  • Add ksp processor base and udpate gradle scripts.

    Add ksp processor base and udpate gradle scripts.

    • Update Gradle Versions.
    • Update Kotlin from 1.5 to 1.5.30.
    • Add KSP processor and provider but valid implementation not yet implemented.

    TODO:

    • Implement KSP processors and generators.
    • Remove KAPT.
    enhancement 
    opened by ivanisidrowu 3
  • Kotlin 1.5.0-RC compatibility issue

    Kotlin 1.5.0-RC compatibility issue

    Hello, Kotlin 1.5.0-RC is around the corner and I checked if it played nicely with KtRssReader, but due to the new Duration api changes it wasn't happy about it;

    java.lang.NoSuchMethodError: No static method getDays(I)D in class Lkotlin/time/DurationKt; or its super classes (declaration of 'kotlin.time.DurationKt' appears in /data/app/~~8tbLKXsRF-XaLJOxrS_dhQ==/com.example.test.android.app-6jJoF5SXNmXOC7dOK8x6_g==/base.apk!classes26.dex)
            at tw.ktrssreader.config.KtRssReaderConfig.<init>(KtRssReaderConfig.kt:31)
            at com.example.test.android.feed.net.FeedNetDataSourceImpl.read(FeedNetDataSourceImpl.kt:19)
            at com.example.test.android.feed.FeedRepositoryImpl$fetchFeed$2.invokeSuspend(FeedRepositoryImpl.kt:52)
            at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
            at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
            at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
            at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
            at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
            at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
    

    I started here: https://github.com/ivanisidrowu/KtRssReader/pull/70 but I havent tried it yet since I couldn't figure out where you change the project version so I could publish locally and try it in my own project..

    edit: I did some further investigation and its still unclear what causes this crash, only did the problem go away if I uninstalled the kotlin plugin in android studio (canary) and reinstalled the latest stable one via File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle.

    opened by sphrak 3
  • Add support for itunes:summary field in items

    Add support for itunes:summary field in items

    Take a look at the feed of Inside Java podcast:

    <item>
        <title>#12 - “jpackage” with Kevin Rushforth</title>
        <itunes:title>“jpackage” with Kevin Rushforth</itunes:title>
        <pubDate>Thu, 11 Feb 2021 11:57:06 +0000</pubDate>
        <guid isPermaLink="false"><![CDATA[c0cdd551-0fc0-4eaa-bccf-e43360ed04a9]]></guid>
        <link><![CDATA[https://inside.java/2021/02/11/podcast-012/]]></link>
        <itunes:image href="http://static.libsyn.com/p/assets/f/8/0/a/f80a626bd25156f4/Inside_Java_Apple_Podcast_3000_tile.png" />
        <description><![CDATA[…]]></description>
        <content:encoded><![CDATA[…]]></content:encoded>
        <enclosure length="20706817" type="audio/mpeg" url="http://traffic.libsyn.com/insidejava/InsideJava-Ep012.mp3?dest-id=2318780" />
        <itunes:duration>25:07</itunes:duration>
        <itunes:explicit>clean</itunes:explicit>
        <itunes:keywords>distribution,packaging,jdk,openjdk,jdk16</itunes:keywords>
        <itunes:subtitle><![CDATA[…]]></itunes:subtitle>
        <itunes:summary>…</itunes:summary>
        <itunes:season>1</itunes:season>
        <itunes:episode>12</itunes:episode>
        <itunes:episodeType>full</itunes:episodeType>
        <itunes:author>David Delabassee, Kevin Rushforth</itunes:author>
    </item>
    

    They use HTML markup for descriptions, but they have the same text in itunes:summary and itunes:subtitle, but without any tags. It would be really great to support them.

    opened by madhead 3
  • Why minSdk 23?

    Why minSdk 23?

    I noticed that the library seems to work for most part with API version 21. Is there some reason that the minimum version is 23?

    Thanks for the nice library.

    good first issue 
    opened by JarmoKukkola 1
  • Fully integrate KSP to the lib and completely remove KAPT.

    Fully integrate KSP to the lib and completely remove KAPT.

    Description

    • Integrate KSP for generating parsers.
    • Remove KAPT from KtRssReader completely.
    • Update KotlinPoet to 1.10.2.
    • Use kotlinpoet-ksp interop lib. https://square.github.io/kotlinpoet/interop-ksp/
    • Run and pass all the instrumented and JVM unit tests.

    Todo

    • Final checks before releasing version 2.2.

    Screenshots

    Screen Shot 2022-04-03 at 6 51 11 PM Screen Shot 2022-04-03 at 6 48 09 PM Screen Shot 2022-04-03 at 6 46 26 PM Screen Shot 2022-04-03 at 5 26 59 PM enhancement 
    opened by ivanisidrowu 1
  • Add pure Kotlin parser code generators with annotation support.

    Add pure Kotlin parser code generators with annotation support.

    此次新增與調整項目

    1. 新增 kapt argument 來讓 annotation processor 決定要產生純 Kotlin 或是 Android 的 parser 。
    2. 調整 extension generator 和 parser generator 的結構,讓某些功能可以共用。
    3. 新增 純 Kotlin annotation processor 的測試,共三個 class ,測項沿用之前的測項。

    純。Kotlin Parser Generation

    新增用法

    在 build.gradle 裡面寫上 kapt 專用的 argument 。

    kapt {
        arguments {
            arg("pureKotlinParser", true)
        }
    }
    

    這樣就可以讓 annotation processor gen 出純 Kotlin 的 parser 了。 這麼做的好處是可以共用 annotation processor 和 generator 部分功能,不必另開 module 去處理。

    Generator 結構調整

    Generator   ----> ExtensionGenerator ----> AndroidExtensionGenerator, KotlinExtensionGenerator
    <interface>  |
                 | -> ParserGenerator    ----> AndroidParserGenerator, KotlinParserGenerator
    
    

    備註

    • 如果想看 gen 出來的 code 可以直接 check out 這麼 branch ,然後 rebuild project,找 TestRssDataParserRawRssDataParserMixRssDataParser 看看效果。
    • 產生的程式碼都在 tw.ktrssreader.generated package 下面。
    • Kotlin Poet document: https://square.github.io/kotlinpoet/
    enhancement 
    opened by ivanisidrowu 0
  • Add pure Kotlin rss standard parser.

    Add pure Kotlin rss standard parser.

    • Made 'testCommon' a pure Kotlin module.
    • Moved common classes to the kotlin module.
      • ChannelItemTestData: From module android to testCommon.
    • Fixed tests.
      • DatabaseRssCacheLocalTest: applicationContext is not initiated.
    • Added pure Kotlin parser RssStandardParser in kotlin module.
      • Used JAVA DOMParser to parse XML. I tried SAX and SAtX, but they do not support getting value by specific tags. Even thought it consumes much more memory, but the kotlin module mostly for non-mobile environment. I think it's acceptable.
    • Added pure Kotlin parser RssStandardParser tests.
    enhancement 
    opened by ivanisidrowu 0
  • Rename parsers in the android module.

    Rename parsers in the android module.

    • Renamed parsers in android module by adding prefix "Android".
      • ParserBase -> AndroidParserBase
      • GoogleParser -> AndroidGoogleParser
      • ITunesParser -> AndroidITunesParser
      • AutoMixParser -> AndroidAutoMixParser
    enhancement 
    opened by ivanisidrowu 0
  • Move common classes from android module to pure kotlin module.

    Move common classes from android module to pure kotlin module.

    Move common classes from the android module to the pure Kotlin module

    Classes included...

    • PaserConst
    • Channel
    • Cloud
    • Image
    • Owner
    • TextInput
    • Category
    • Enclosure
    • Guid
    • Items
    • Source
    • Parser
    opened by ivanisidrowu 0
  • Fixed the Gradle artifacts

    Fixed the Gradle artifacts

    • Add the Gradle artifacts.
    • Avoid compiler errors of the generated code for the Kotlin 1.3 users because of the trailing commas and the mixed index function parameters.
    opened by ivanisidrowu 0
  • IllegalAccessError: cannot access class com.sun.org.apache.xerces.internal.dom.DeferredElementImpl

    IllegalAccessError: cannot access class com.sun.org.apache.xerces.internal.dom.DeferredElementImpl

    It seems that the implementation uses internal (non-exported) classes:

    class tw.ktrssreader.kotlin.parser.ParserBase (in unnamed module @0x443effcb) cannot access class com.sun.org.apache.xerces.internal.dom.DeferredElementImpl (in module java.xml) because module java.xml does not export com.sun.org.apache.xerces.internal.dom to unnamed module @0x443effcb
    java.lang.IllegalAccessError: class tw.ktrssreader.kotlin.parser.ParserBase (in unnamed module @0x443effcb) cannot access class com.sun.org.apache.xerces.internal.dom.DeferredElementImpl (in module java.xml) because module java.xml does not export com.sun.org.apache.xerces.internal.dom to unnamed module @0x443effcb
    	at tw.ktrssreader.kotlin.parser.ParserBase.readString(ParserBase.kt:229)
    	at tw.ktrssreader.kotlin.parser.AutoMixParser.parseChannelTags(AutoMixParser.kt:136)
    	at tw.ktrssreader.kotlin.parser.AutoMixParser.parse(AutoMixParser.kt:89)
    

    Environment: Java 17, Kotlin 1.7.20

    bug 
    opened by NorbertSandor 1
  • Add Gradle task

    Add Gradle task "publishToMavenLocal" to let us test it locally.

    References:

    https://docs.gradle.org/current/userguide/publishing_maven.html https://www.jetbrains.com/help/space/publish-artifacts-from-a-gradle-project.html#publish-maven-artifacts-using-the-gradle-command-line-tool

    enhancement 
    opened by ivanisidrowu 0
Releases(v2.1.2)
  • v2.1.2(May 25, 2021)

  • v2.1.1(Feb 18, 2021)

  • v2.1.0(Feb 6, 2021)

    • Add annotation processor for pure Kotlin parser code generation.
    • Supports @RssTag, @RssValue, @RssAttribute, @RssValue, and @RssRawTag annotations.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.2(Jan 21, 2021)

    • Refactor the Android APP sample.
    • Add pure Kotlin parsers
      • RssStandardParser
      • GoogleParser
      • ITunesParser
      • AutoMixParser
    • Rename Android parsers
      • From RssStandardParser to AndroidRssStandardParser
      • From GoogleParser to AndroidGoogleParser
      • From ITunesParser to AndroidITunesParser
      • From AutoMixParser to AndroidAutoMixParser
    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Nov 12, 2020)

  • v2.0.0(Oct 20, 2020)

    • Added annotations for the custom parser and reader generation.
      • @RssTag
      • @RssAttribute
      • @RssValue
      • @RssRawData
    • Supports custom RSS data format.
    • Improved AutoMixParser performance.
    • Added more samples under the /app module.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Sep 29, 2020)

    Adjust reader config params.

    val result: ITunesChannelData = Reader.read<ITunesChannelData>(rssSource) {
        charset = Charsets.UTF_8
        useCache = false
        expiredTimeMillis = 600000L
    }
    

    useCache: Pull data from cache or remote server. The default setting is set to true. flushCache: Clear the specific cache by URL.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Sep 26, 2020)

Owner
Ivan
Ivan
Generic AST parsing library for kotlin multiplatform

kotlinx.ast kotlinx.ast is a generic AST (Abstract Syntax Tree) parsing library, Kotlin is currently the only supported language. The library is desig

null 235 Dec 29, 2022
KMM RSS Reader: an open-source, mobile, cross-platform application built with Kotlin Multiplatform Mobile.

KMM RSS Reader This is an open-source, mobile, cross-platform application built with Kotlin Multiplatform Mobile. It's a simple RSS reader, and you ca

Kotlin 1.4k Jan 4, 2023
A android platform i.e, App that helps marriage/party halls and individuals to connect to the nearest places where this food could feed those in need and food wastage is minimised

(Muskan- The joy of giving by nature) , a android platform i.e, App that helps marriage/party halls and individuals to connect to the nearest places where this food could feed those in need and food wastage is minimised.

OxVidhi 15 Nov 26, 2022
Run Kotlin/JS libraries in Kotlin/JVM and Kotlin/Native programs

Zipline This library streamlines using Kotlin/JS libraries from Kotlin/JVM and Kotlin/Native programs. It makes it possible to do continuous deploymen

Cash App 1.5k Dec 30, 2022
A somewhat copy past of Jetbrain's code from the kotlin plugin repo to make it humanly possible to test Intellij IDEA kotlin plugins that work on kotlin

A somewhat copy past of Jetbrain's code from the kotlin plugin repo to make it humanly possible to test Intellij IDEA kotlin plugins that work on kotlin

common sense OSS 0 Jan 20, 2022
Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in Kotlin with Jetpack Compose and a backed in Kotlin hosted on AppEngine.

Conferences4Hall Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in K

Gérard Paligot 98 Dec 15, 2022
[Android Library] A SharedPreferences helper library to save and fetch the values easily.

Preference Helper A SharedPreferences helper library to save and fetch the values easily. Featured in Use in your project Add this to your module's bu

Naveen T P 13 Apr 4, 2020
Kotlin library for Android

KAndroid Kotlin library for Android providing useful extensions to eliminate boilerplate code in Android SDK and focus on productivity. Download Downl

Paweł Gajda 890 Nov 13, 2022
A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library.

MaterialDrawerKt Create navigation drawers in your Activities and Fragments without having to write any XML, in pure Kotlin code, with access to all t

Márton Braun 517 Nov 19, 2022
🔓 Kotlin version of the popular google/easypermissions wrapper library to simplify basic system permissions logic on Android M or higher.

EasyPermissions-ktx Kotlin version of the popular googlesample/easypermissions wrapper library to simplify basic system permissions logic on Android M

Madalin Valceleanu 326 Dec 23, 2022
Android Spinner Dialog Library supported on both Java and Kotlin, Use for single or multi selection of choice

SpinnerDialog Android Spinner Dialog Library, Use for single or multi selection of choice Android UI Download To include SpinnerDialog in your project

Hamza Khan 55 Sep 15, 2022
A Kotlin library for reactive and boilerplate-free SharedPreferences in Android

KPreferences A Kotlin library for reactive and boilerplate-free Shared Preferences in Android. With KPreferences you can use Kotlin's marvelous delega

Mohamad Amin Mohamadi 19 Dec 16, 2020
AbstractMvp 0.8 0.0 Kotlin is a library that provides abstract components for MVP architecture realization, with problems solutions that are exist in classic MVP.

MinSDK 14+ AbstractMvp AbstractMvp is a library that provides abstract components for MVP architecture realization, with problems solutions that are e

Robert 12 Apr 5, 2022
The most complete and powerful data-binding library and persistence infra for Kotlin 1.3, Android & Splitties Views DSL, JavaFX & TornadoFX, JSON, JDBC & SQLite, SharedPreferences.

Lychee (ex. reactive-properties) Lychee is a library to rule all the data. ToC Approach to declaring data Properties Other data-binding libraries Prop

Mike 112 Dec 9, 2022
A Bluetooth kotlin multiplatform "Cross-Platform" library for iOS and Android

Blue-Falcon A Bluetooth "Cross Platform" Kotlin Multiplatform library for iOS, Android, MacOS, Raspberry Pi and Javascript. Bluetooth in general has t

Andrew Reed 220 Dec 28, 2022
A lightweight cache library written in Kotlin

[NEW] Released to Maven Central: 'com.github.yundom:kache:1.x.x' Kache A runtime in-memory cache. Installation Put this in your build.gradle implemen

Dennis 22 Nov 19, 2022
A Kotlin Android library for content provider queries with reactive streams and coroutines.

Pickpocket An Android library for content provider queries with reactive streams and coroutines. Calendar Contacts SMS MMS Files/Media Call Log Bookma

Chris Basinger 27 Nov 14, 2022
A Kotlin Android library for heuristics evasion that prevents your code from being tested.

EvadeMe An Android library for heuristics evasion that prevents your code from being tested. User Instructions Add the maven repository to your projec

Chris Basinger 29 Dec 26, 2022
Easy lightweight SharedPreferences library for Android in Kotlin using delegated properties

Easy lightweight SharedPreferences library for Android in Kotlin using delegated properties Idea Delegated properties in Kotlin allow you to execute a

null 25 Dec 27, 2022