简体   繁体   English

使用Java的RSS阅读器和解析器

[英]RSS Reader and parser using java

I need to implement the RSS reader kind of using Java. 我需要使用Java来实现RSS阅读器。

I have designed the Java class which reads the RSS feed XML URL and get the contents and store it in Java class. 我设计了Java类,该类读取RSS feed XML URL并获取内容并将其存储在Java类中。

Whenever there is an update in RSS feel URL, i need to parse the RSS feed XML URL using Java class, only then i could get the updated contents. 每当RSS感觉URL中有更新时,我都需要使用Java类解析RSS feed XML URL,只有这样我才能获取更新的内容。

The problem here is how we notify the Java class that RSS feel XML URL has been updated, so that Java class could parse the URL and get the updated contents? 这里的问题是我们如何通知Java类RSS感觉XML URL已更新,以便Java类可以解析URL并获取更新的内容?

Do we have to implement thread to run the parsing process continously? 我们是否必须实现线程才能连续运行解析过程? or any alternative optimal solutions there? 还是那里有其他替代性最佳解决方案?

You could use a cron job that runs the java application to parse the rss feed. 您可以使用运行Java应用程序的cron作业来解析rss feed。 It depends on the frequency the RSS feed is going to get updated. 这取决于RSS提要更新的频率。 You could implement a polling solution here if the information in the RSS feed is updated frequently. 如果RSS feed中的信息经常更新,则可以在此处实施轮询解决方案。 This would involve setting up a thread that sleeps for a certain amount of time, then recalls the parse method. 这将涉及建立一个睡眠一定时间的线程,然后调用parse方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM