Giter Club home page Giter Club logo

rss-parser's Issues

No image in some articles

Hi, I have a problem with images in articles. The parser doesn't recognize some images in < img /> tag in content.
I sent you a pictures with sucess image in article and null image in article.
The feed is it: https://instatecno.com/feed

RSS no imagen
RSS si imagen

error

E/HW-JPEG-DEC: HME_JPEG_DEC_Delete: HME_JPEG_DEC_Delete: decoder_ctx=null
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.limitless.limitless.applicationunivercity, PID: 17238
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:330)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:255)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:776)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/OkHttpClient;
at com.prof.rssparser.Parser.doInBackground(Parser.java:61)
at com.prof.rssparser.Parser.doInBackground(Parser.java:34)
at android.os.AsyncTask$2.call(AsyncTask.java:316)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:255) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
at java.lang.Thread.run(Thread.java:776) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.OkHttpClient" on path: DexPathList[[zip file "/data/app/com.limitless.limitless.applicationunivercity-1/base.apk", zip file "/data/app/com.limitless.limitless.applicationunivercity-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.limitless.limitless.applicationunivercity-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.limitless.limitless.applicationunivercity-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.limitless.limitless.applicationunivercity-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.limitless.limitless.applicationunivercity-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.limitless.limitless.applicationunivercity-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.limitless.limitless.applicationunivercity-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.limitless.limitless.applicationunivercity-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.limitless.limitless.applicationunivercity-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.limitless.limitless.applicationunivercity-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.limitless.limitless.applicationunivercity-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.limitless.limitless.applicationunivercity-1/lib/arm64, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.prof.rssparser.Parser.doInBackground(Parser.java:61) 
at com.prof.rssparser.Parser.doInBackground(Parser.java:34) 
at android.os.AsyncTask$2.call(AsyncTask.java:316) 
at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:255) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
at java.lang.Thread.run(Thread.java:776) 

Is there a way to stop the background thread?

Until now, as Parser was just an AsyncTask, I would call parser.cancel(boolean mayInterruptIfRunning). However, this is no longer possible. Is there a way to interrupt or cancel the background processing with the new system?

Can not parse `pubDate` tag which has inner `time` tag

Parse a rss feed whose items contain pubDate tags with a child tag (time). Eg:

<item>
  <title>Sample title</title>
  <link>http://www.sample-link.com</link>
  <description>Sample description</description>
  <pubDate>
    <time datetime="2019-05-12T10:00:00Z">Sun, 05/12/2019 - 10:00</time>
  </pubDate>
</item>

Expected result: Item whose pubDate equals to Sun, 05/12/2019 - 10:00
Actual result: App crashed.

RSS Update

Is there a way to know if the article has updated?

RSS Filter

Any plans to add a filter for the RSS feed?

Audio path

Some rss feeds have the path to the audio file in the <link> element of the item and some are missing the <link> element altogether or do not have the url to the audio file in that element. However, many have the path to the audio file as url attribute in the <enclosure> element. Can a check for type audio be added to the enclosure part of CoreXMLParser.kt, so that the path to the audio file is included in Article?

Please refer to the rss feed: https://feeds.megaphone.fm/stuffyoushouldknow/

Parser crashes on API<21 with HTTPS: "java.net.SocketTimeoutException [...] (port 443)"

EDIT: see post below for better specif for the error. This was not the real problem, but was caught by the try...catch block.
On API 20 and down, the parser does not parse anything. I get at runtime with a try...catch block

I/dalvikvm: Could not find method java.time.Duration.toMillis, referenced from method okhttp3.OkHttpClient$Builder.readTimeout
W/dalvikvm: VFY: unable to resolve virtual method 42983: Ljava/time/Duration;.toMillis ()J

I compile with Java 8 support, which is, to the best of my knowledge, the recommended version for Android development. I would like to target API 16+. I am using Kotlin. In my build.gradle there is:

    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }

It's odd that no error is raised on API21+. I assume it is because of the transition to Android Runtime (ART) instead of the Dalvik VM. I am a bit surprised since I saw on your Readme that your library was compliant with API15+.

Where did things go wrong? Should I use a newer version of Java? (is it even possible for Android?). Is your library actually limited to API21+?

Thank you very much.

Atom

Any chance of adding Atom support ?

I have i question about Licence

I'm thinking of replacing my project with this one. I have rss reader android app (app is monetized with admob). Is it allowed to use this project. I do not understand licence. I apologize for posting this.

Conflicting gradle 'compile' line

Hey, thanks for your library!

I'm still coding with a Java stack so I've tried to include your gradle variant.
The issue is that gradle has recently deprecated the 'compile' option - so I replaced it with the


implementation ("com.prof.rssparser:rssparser:2.0.4") {
    exclude group: 'org.jetbrains', module: 'annotations'
}

section - 'exclude' option is because i've already had an

implementation 'org.jetbrains:annotations-java5:15.0'

line - that issued a ton of a
Duplicate class org.intellij.lang.annotations.Flow found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-15.0.jar (org.jetbrains:annotations-java5:15.0)
errors, so I bypassed em by staying with already present annotations.

Cheers!

Project does not building when android:allowBackup="false" is set in Manifest

The application can no longer be built when the application has android:allowBackup="false" because the library has android:allowBackup="true" :

Error:Execution failed for task ':app:processFreeDebugManifest'.
> Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:30:9-36
  	is also present at [com.prof.rssparser:rssparser:1.0] AndroidManifest.xml:12:9-35 value=(true).
  	Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:28:5-166:19 to override.

Suggestion: remove the android:allowBackup="true" from the lib manifest.

Additional, maybe also remove android:label="@string/app_name" and android:supportsRtl="true"

Last update blocking UI thread on full Java project

I have experience a UI block in my project when upgrading the library from 1.4.4 to 2.0.1. The layout stops responding until all articles are parsed. The parser would make the call here to be represented in this layout.

I also tried parsing only one url with the same code and the UI stills blocks.

Title of RSS Channel

Hi, is there a way to get the title of the RSS channel from your library?
Or can you only get the data for new entries.
Thanks.

More channel info

Thanks for the very useful library =)
Can you please add more channel related info? In particular:

  • Last build date: <lastBuildDate>Mon, 20 Jan 2020 22:40:08 +0000</lastBuildDate>
  • Update period: <sy:updatePeriod>hourly</sy:updatePeriod>

It would be convenient to check first, whether it is time to grab new articles from a feed. Could reduce requests count.

please make tutorial for beginer

is there step by step for beginners like me, honestly I'm confused because I'm still a beginner so please complete the tutorial, thank you

java.net.ProtocolException: Expected leading [0-9a-fA-F] character but was 0x1f

Hi, testing this url http://www.prensa-latina.cu/index.php?o=vc&id=principal&SEO=canalrss-principal the library throws this error:

W/System.err: java.net.ProtocolException: Expected leading [0-9a-fA-F] character but was 0x1f
09-07 11:24:34.088 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at okhttp3.internal.http.Http1xStream$ChunkedSource.readChunkSize(Http1xStream.java:448)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at okhttp3.internal.http.Http1xStream$ChunkedSource.read(Http1xStream.java:422)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at okio.RealBufferedSource.read(RealBufferedSource.java:50)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at okio.RealBufferedSource.request(RealBufferedSource.java:71)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at okio.RealBufferedSource.require(RealBufferedSource.java:64)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at okio.GzipSource.consumeHeader(GzipSource.java:114)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at okio.GzipSource.read(GzipSource.java:73)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at okio.Buffer.writeAll(Buffer.java:956)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at okio.RealBufferedSource.readByteArray(RealBufferedSource.java:92)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at okhttp3.ResponseBody.bytes(ResponseBody.java:83)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at okhttp3.ResponseBody.string(ResponseBody.java:109)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at com.prof.rssparser.Parser.doInBackground(Parser.java:68)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at com.prof.rssparser.Parser.doInBackground(Parser.java:34)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at android.os.AsyncTask$2.call(AsyncTask.java:295)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
09-07 11:24:34.093 18673-20271/cu.entumovil.barrosofeedsnews W/System.err: at java.lang.Thread.run(Thread.java:818)

Is there any way to fix it?

Pagination

Thanks for this awesome library. Was wondering if there's a way to achieve pagination with this library.

Issue with accented characters

Hi @prof18 !!

Thanks so much, for sharing this useful library. I'm just started to use it in my app and I have found one problem. The RSS that I'm using (https://www.kitmaker.net/rss/rss_0.xml) includes some accented characters like in this title:

Armorama : Dnepromodel: Big Scale Zrínyi II

When showing this text in the app, those characters appear like a diamond with a question mark. Do you know how to solve this issue? I have tried some parsing after retrieving the contents but I had no luck with it so far.

Best regards
Juan

Unable to add to my project

Having trouble adding this to my project.

I add the dependency to my app bundle but then attempt a re-sync it gives a big old 👎
Error:(88, 13) Failed to resolve: com.prof.rssparser:rssparser:1.1

Doesn't seem like its on JCenter.

small issue

Hi , First thanks for the great library .

i am trying to fetch an rss from this url : https://www.skynewsarabia.com/web/rss/markets.xml

or this : http://gulf.argaam.com/rss/home/sectionid/0?entityId=3

but the application crashes and give me this error :

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.alrabei.myproject, PID: 6136 java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference at com.alrabei.myproject.ArticleAdapter.onBindViewHolder(ArticleAdapter.java:100) at com.alrabei.myproject.ArticleAdapter.onBindViewHolder(ArticleAdapter.java:44)

i am wondering if i can fetch the rss from any website and how

Channel Description

"channelDescription" is not set, if "RSSKeywords.RSS_CHANNEL_IMAGE" comes before "RSSKeywords.RSS_ITEM_DESCRIPTION".

Possible fix (didn't check):
In "CoreXMLParser.kt" remove "insideChannel = false" from "RSSKeywords.RSS_CHANNEL_IMAGE" and add it to "eventType == XmlPullParser.END_TAG && xmlPullParser.name.equals("channel", ignoreCase = true)".

Please refer to this rss:
http://joeroganexp.joerogan.libsynpro.com/rss

No Image

Image is returning null always.

OkHttpClient setter or constructor

Hi,
Great library you've made there. I am using it on my app with minsdk 17, which
makes default tlsv1.2 support a bit of a pain. It would be great, if there was a way to set
a custom OkHttpClient for the library to be used.
I would do a pull request but i dont know Kotlin :(
But i think its not that hard of a feature to implement.
Just make the constructor take an OkHttpClient instance as an argument or do a setter for the client.
I've done it in java and it wokrs fine .

`

private OkHttpClient myclient;
private OnTaskCompleted onComplete;
public Parser() {
    xmlParser = new XMLParser();
    xmlParser.addObserver(this);
}
public Parser(OkHttpClient client) {
    this.myclient = client;
    xmlParser = new XMLParser();
    xmlParser.addObserver(this);
}
public interface OnTaskCompleted {
    void onTaskCompleted(ArrayList<com.prof.rssparser.Article> list);

    void onError(Exception exception);
}
public void onFinish(OnTaskCompleted onComplete) {
    this.onComplete = onComplete;
}
@Override
protected String doInBackground(String... ulr) {
    Response response = null;
    OkHttpClient client = null;
    if(myclient!=null)
        client=myclient;
    else
        client=new OkHttpClient();
    Request request = new Request.Builder()`

App Crash

App crashes after using version 1.4 works fine in 1.3.1

Unterminated entity ref Exception

Hi, i have a problem with your library. If in the rss page there is "&" char (not &amp) an exception is raised.
For example trythis link http://insubs.com/rss
"onError()" isn't called, but even if there is an Exception, library tell me "RSS Parser: RSS parsed correctly!"

W/System.err: org.xmlpull.v1.XmlPullParserException: unterminated entity ref (position:TEXT @1:195 in java.io.StringReader@93bd24d)
W/System.err: at org.kxml2.io.KXmlParser.readEntity(KXmlParser.java:1219)
W/System.err: at org.kxml2.io.KXmlParser.readValue(KXmlParser.java:1401)
W/System.err: at org.kxml2.io.KXmlParser.next(KXmlParser.java:393)
W/System.err: at org.kxml2.io.KXmlParser.next(KXmlParser.java:313)
W/System.err: at org.kxml2.io.KXmlParser.nextText(KXmlParser.java:2075)
W/System.err: at com.prof.rssparser.XMLParser.parseXML(XMLParser.java:66)
W/System.err: at com.prof.rssparser.Parser.onPostExecute(Parser.java:79)
W/System.err: at com.prof.rssparser.Parser.onPostExecute(Parser.java:34)
W/System.err: at android.os.AsyncTask.finish(AsyncTask.java:651)
W/System.err: at android.os.AsyncTask.-wrap1(AsyncTask.java)
W/System.err: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err: at android.os.Looper.loop(Looper.java:148)
W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5417)
W/System.err: at java.lang.reflect.Method.invoke(Native Method)
W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I/RSS Parser: RSS parsed correctly!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.