RSS-Parser icon indicating copy to clipboard operation
RSS-Parser copied to clipboard

support simple atom rss

Open Haoxiqiang opened this issue 2 years ago • 3 comments

As the issue https://github.com/prof18/RSS-Parser/issues/38 I have a pr simple support.

more work should be done. e.g. atom file has a diff time format( 2021-11-11T00:00:00+00:00Z) which the android does not support well. I need more atom XML files to optimize the compatibility.

Haoxiqiang avatar Nov 24 '21 13:11 Haoxiqiang

And I have the file. https://jakewharton.com/atom.xml that JakeWharton's blog. I have fallen in

<entry>
    <title>The state of managing state (with Compose)</title>
    <link href="https://code.cash.app/the-state-of-managing-state-with-compose"/>
    <updated>2021-11-11T00:00:00+00:00</updated>
    <id>https://jakewharton.com/the-state-of-managing-state-with-compose</id>
    <content type="html">
        This post was published externally on Cash App Code Blog. Read it at
        <a href="https://code.cash.app/the-state-of-managing-state-with-compose">https://code.cash.app/the-state-of-managing-state-with-compose</a>
        .
    </content>
</entry>

I have to add a try-catch to ignore the crash.

try {
    val content = xmlPullParser.nextTrimmedText()
    articleBuilder.content(content)
    imageUrlFromContent = getImageUrl(content)
} catch (throwable: Throwable) {
    // TODO some content tag with the no CDATA html that like this:
    // <content type="html">
    //  This post was published externally on Cash App Code Blog. Read it at
    //  <a href="https://code.cash.app/the-state-of-managing-state-with-compose">https://code.cash.app/the-state-of-managing-state-with-compose</a>
    //  .
    // </content>
    continue@loop
}

Haoxiqiang avatar Nov 24 '21 13:11 Haoxiqiang

Ah interesting, thank you very much for the work! 🙏

I will look at what's missing and try to complete the feature!

prof18 avatar Nov 24 '21 14:11 prof18

You know the 2021-11-11T00:00:00+00:00Z format and others time format was supported by joda time, but it is a little large for the android platform. I have tried some atom files, the vexed question of content format, as the HTML but without <![CDATA[]]> I'm wondering if the XmlPullParser wasn't enough.

Haoxiqiang avatar Nov 25 '21 02:11 Haoxiqiang

What's the plan to merge this in the branch?

ashishb avatar Feb 14 '23 07:02 ashishb

e.g. atom file has a diff time format( 2021-11-11T00:00:00+00:00Z) which the android does not support well.

I believe this is Zulu time format and you can parse this with

new SimpleDateFormat("yyyy-MM-d'T'HH:mm:ss", Locale.ENGLISH).parse(date)

ashishb avatar Feb 19 '23 23:02 ashishb

What's the plan to merge this in the branch?

I'm planning to integrate it in the future but I don't have an ETA yet.

prof18 avatar Feb 20 '23 09:02 prof18

@prof18 Happy to help if you would like.

ashishb avatar Feb 22 '23 00:02 ashishb

@prof18 Happy to help if you would like.

Thanks! I'm planning a bit of refactor before integrating this. But if I need help, I'll let you know 🙏

prof18 avatar Feb 23 '23 18:02 prof18

@prof18 friendly ping to look into this again :)

ashishb avatar Apr 10 '23 04:04 ashishb

I believe the format mentioned above would also support The Verge's format (https://www.theverge.com/rss/index.xml) if i'm not mistaken. Any chance this can be merged?

j-roskopf avatar May 26 '23 00:05 j-roskopf

Sorry for not getting back to you sooner, but I was focusing more on the migration to Kotlin Multiplatform. Since this seems to be a very requested feature, I will start working on that! A reasonable ETA for a new release could be around 2/3 weeks 💪

prof18 avatar May 28 '23 09:05 prof18