ouattararomuald / syndication Goto Github PK
View Code? Open in Web Editor NEWA Kotlin library for reading RSS 2.0 and ATOM 1.0 syndication feeds.
License: Apache License 2.0
A Kotlin library for reading RSS 2.0 and ATOM 1.0 syndication feeds.
License: Apache License 2.0
Hello, When using R8 always get an exception with null when reading a RSS in the try catch block. If I don't use the problem does not happend. I don't understand if the problem is with an internal optimization that R8 tries to do., a Are you seen the same problem with R8 optimization eneabled ?
This is the part of the code:
fun getRssFedd(host:String):List<TwitterData>{
val trustManager = TrustAllX509TrustManager.INSTANCE
val client = OkHttpClient.Builder()
.sslSocketFactory(
sslContext(
null,
arrayOf<TrustManager>(trustManager)
).socketFactory,
trustManager)
.hostnameVerifier(TrustAllX509TrustManager.allowAllHostNames())
.build()
val mySyndication = Syndication(
url = host,
httpClient =client )
val reader = mySyndication.create(RssReader::class.java)
var lista : List<TwitterData>
try {
val rssFeed = reader.readRss()
lista = convRssFeed(rssFeed)
}
catch (e:Exception){
Log.e("Error reading RSS","${e.message}")
lista = mutableListOf<TwitterData>()
}
return lista
}
Serializable
or Parcelable
(for better performance on android)
In the current state, if the user wants to parse a feed that contains non-conventional fields, it is not possible. Also the API has lots of nullable fields, which is not very good for consumer.
It will be good to have some annotations:
@Atom
@Rss
that can be used to mark custom classes. If a class is marked with the annotations above then the adapters will not enforce the return type to be AtomFeed
or RssFeed
.
Usage:
@Atom
data class MyRss(
@param:Element
@field:Element
val channel: MyChannel
)
and you're now able to have an interface like this:
@Atom
interface MyReader {
fun readRss(): MyRss
}
Because we all have responsibilities, we trust you on the implementation of your custom class (MyRss
here).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.