https://github.com/faruktoptas/retrofitrssconverterfactory
A Retrofit 2 converter which parses Rss feeds
https://github.com/faruktoptas/retrofitrssconverterfactory
kotlin-library retrofit2 retrofit2-converter rss-feed rss-feed-parser rss-reader
Last synced: 11 months ago
JSON representation
A Retrofit 2 converter which parses Rss feeds
- Host: GitHub
- URL: https://github.com/faruktoptas/retrofitrssconverterfactory
- Owner: faruktoptas
- License: apache-2.0
- Created: 2017-04-05T15:25:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-02-17T12:52:35.000Z (over 5 years ago)
- Last Synced: 2025-04-10T10:58:42.204Z (over 1 year ago)
- Topics: kotlin-library, retrofit2, retrofit2-converter, rss-feed, rss-feed-parser, rss-reader
- Language: Kotlin
- Size: 629 KB
- Stars: 73
- Watchers: 3
- Forks: 19
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Retrofit2 Rss Converter Factory [](https://travis-ci.org/faruktoptas/RetrofitRssConverterFactory) [](https://jitpack.io/#faruktoptas/RetrofitRssConverterFactory) [](https://android-arsenal.com/api?level=10)
A Retrofit2 converter which parses Rss feeds.
# Gradle Dependency
Add this in your root `build.gradle` file (**not** your module `build.gradle` file):
```gradle
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```
Then, add the library to your module `build.gradle`
```gradle
dependencies {
implementation 'com.github.faruktoptas:RetrofitRssConverterFactory:0.1.0'
}
```
## Sample Usage
```kotlin
interface RssService {
@GET
fun getRss(@Url url: String): Call
}
```
```java
val retrofit = Retrofit.Builder()
.baseUrl("https://github.com")
.addConverterFactory(RssConverterFactory.create())
.build()
val service = retrofit.create(RssService::class.java)
service.getRss("RSS_FEED_URL")
.enqueue(object : Callback {
override fun onResponse(call: Call, response: Response) {
// Populate list with response.body().getItems()
}
override fun onFailure(call: Call, t: Throwable) {
// Show failure message
}
})
```
## Contribute
You can contribute by opening a pull request to **dev** branch.
Please try to push one feature in one commit for a clean commit history.
License
=======
Copyright 2017 Faruk Toptaş
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.