einmalfel / earl Goto Github PK
View Code? Open in Web Editor NEWEasy Android RSS (and also Atom) Library
Easy Android RSS (and also Atom) Library
Hello,
I was trying to use the library and it seems to be failing to parse some fields, for example for this one: http://www.blogtalkradio.com/bobdavis/podcast
While the feed does have itunes tags, feed.itunes is null, and feed.items has size = 0.
This happens with all rss feeds from BlogTalkRadio
Parsing this URL http://rss.slashdot.org/Slashdot/slashdotMain will fail with
expected: START_TAG {}channel (position:START_TAG <channel {http://www.w3.org/1999/02/22-rdf-syntax-ns#}rdf:about='http://slashdot.org/'>@4:43 in java.io.InputStreamReader@4a335fa8)
Error message is:
"Failed to parse RFC3339 string 2016-03-12T0936:25+00:00"
Note how there's a colon missing in the time part. I think it's caused by the timezone being prefixed with a + instead of a - which breaks an assumption made in Utils.java#L78-80
//step one, split off the timezone.
String firstPart = string.substring(0, string.lastIndexOf('-'));
String secondPart = string.substring(string.lastIndexOf('-'));
Why the description and summary of an Item are not separated?
There is only one method to retrieve the description. What if I want for example to retrieve the summary instead?
Maybe they can be used for different purposes, like for example to have a "read more" button which will extend the summary into description.
Any relative paths that exist in a feed should be properly handled by Utils.tryParseUrl()
. Once you merge in the pulls awaiting you, I can send another pull to take care of this.
I was testing this feed: http://www.volkskrant.nl/cartoons/rss.xml and i noticed that although media content list inside RSSItem gets populated correctly (including the URL) the thumbnails list is empty. Right now i need to check if returned URL is empty and return the content url myself if not there. Is this is a bug? Resource is correctly marked as image mime type in the XML.
Some RSS 2.0 feeds do not have an <author> element, but rather have a <dc:creator> one if they only have the author's name and no e-mail address. Please consider using <dc:creator> as a fallback element if <author> is missing.
EDIT: My suggestion is more broadly to support Dublin Core attributes. References: http://www.lowter.com/blogs/2008/2/9/rss-dccreator-author
http://web.resource.org/rss/1.0/modules/dc/
Hey,
I was testing my application and I got the error:
java.lang.NullPointerException
at com.einmalfel.earl.EarlParser.parseOrThrow(EarlParser.java:46)
at org.secfirst.umbrella.RSSFeedParserTest.getInformationAboutChannelInXmlV1(RSSFeedParserTest.java:74)
I believe that occurs ever you try to mock your RSS like this: src/test/resources/bbc_rss.xml.
@Test
public void getInformationAboutChannelInXmlV1() throws IOException, XmlPullParserException, DataFormatException {
InputStream inputStream = getClass().getClassLoader()
.getResourceAsStream("rss_parse/" + "rss_bbc.xml");
Feed feed = EarlParser.parseOrThrow(inputStream, 0);
assertEquals(feed.getTitle(), "BBC News - Business");
assertEquals(feed.getDescription(), "BBC News - Business");
assertEquals(feed.getImageLink(), "http://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif");
}
Hi,
cant parse the following date format:
W/Earl.Utils: Malformed date 2016-01-26T12:22:00Z
I get this error with this rss feed:
http://www.finanzen.net/rss/BASF-RSS-Feed
this "RDF" / RSS 1.0 feed will fail aswell, although Earl claims to support RSS 1.0
feed: http://www.polizei.bayern.de/niederbayern/polizei.rss
exception:
W/System.err: org.xmlpull.v1.XmlPullParserException: expected: START_TAG {}channel (position:START_TAG <channel {http://www.w3.org/1999/02/22-rdf-syntax-ns#}rdf:about='http://www.polizei.bayern.de/muenchen'>@13:60 in java.io.InputStreamReader@c6cbf9d)
W/System.err: at org.kxml2.io.KXmlParser.require(KXmlParser.java:2065)
W/System.err: at com.einmalfel.earl.RSSFeed.read(RSSFeed.java:77)
W/System.err: at com.einmalfel.earl.EarlParser.parseOrThrow(EarlParser.java:55)
The feed looks pretty much like the standard RSS 1.0 to me :
http://web.resource.org/rss/1.0/spec
It's a valid feed;
https://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fwww.polizei.bayern.de%2Fniederbayern%2Fpolizei.rss
A quick debug shows that the feed offers a namespace:
xmlns="http://purl.org/rss/1.0/"
However in RSSFeed.java read(...) the first line expects the namesspace to be "" :
parser.require(XmlPullParser.START_TAG, XmlPullParser.NO_NAMESPACE, XML_TAG);
this will always fail. This what I can get out of it without any expert XML , RSS background.
This is the link to the line in code above
https://github.com/einmalfel/Earl/blob/master/earl/src/main/java/com/einmalfel/earl/RSSFeed.java#L77
Hi,
Appreciate your effort creating this library.
A feature request, can you implement parsing custom xml tag from the Rss feed.
For example, most of the rss feed includes "" tag, but there's no method to get its value. Something like:
mItem.getCustomTag("lastbuilddate");
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.