GithubHelp home page GithubHelp logo

earl's People

Contributors

einmalfel avatar geniusrus avatar noordawod avatar volixanov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

earl's Issues

Bad parsing of timezone in RFC3339 dates

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('-'));

Description and summary separation

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.

Handle relative paths properly

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.

Error when I was trying to develop unit test.

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");
    }

RSS 1.0 not supported

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

Feature Request Parse Custom Xml Tag

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");

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.