Giter Site home page Giter Site logo

rubycocos / feedparser Goto Github PK

View Code? Open in Web Editor NEW
164.0 6.0 11.0 1.16 MB

feedparser gem - (universal) web feed parser and normalizer (XML w/ Atom or RSS, JSON Feed, HTML w/ Microformats e.g. h-entry/h-feed or Feed.HTML, Feed.TXT w/ YAML, JSON or INI & Markdown, etc.)

License: Creative Commons Zero v1.0 Universal

Ruby 74.37% HTML 25.63%
feed atom rss feedparser jsonfeed microformats hentry hfeed html feedtxt

feedparser's Introduction

(Universal) Web Feed Parser And Normalizer (Atom, RSS, JSON Feed, Feed.TXT, Feed.HTML, HTML w/ Microformats e.g. h-entry, Etc.) And More

Gem Familiy

feedparser - web feed parser and normalizer (Atom, RSS, JSON Feed, HTML h-entry, etc.)

feedfilter - feed filter and rules for easy (re)use

feedtxt - reads Feed.TXT - feeds in text (unicode) - publish & share posts, articles, podcasts, 'n' more

More

feeds - tests, tests, tests - feeds (in Atom, RSS, JSON Feed, HTML h-entry, etc.) with test assertions

awesome-feeds - a collection of awesome feeds (formats, readers, services & tools, templates 'n' more) - JSON Feed, RSS, Atom, HTML w/ Microformats, Feed.TXT

feedparser's People

Contributors

geraldb avatar onli 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  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

feedparser's Issues

JSONFeed parser allows invalid JSONFeeds

Given the below (purposefully broken) JSON feed:

Example JSON Feed ```json { "version": "https://jsonfeed.org/version/1", "title": "Jamie Tanna | Software (Quality) Engineer", "home_page_url": "https://www.jvt.me", "feed_url": "https://www.jvt.me/feed.json", "description": "", "author": { "name": "Jamie Tanna", "url": "https://www.jvt.me", "avatar": "https://www.jvt.me/img/profile.png" }, "items": [ { "image": "https://www.jvt.me/img/profile.png", "date_published": "2019-11-18T15:39:23+00:00","tags": [] } , { "url": "https://www.jvt.me/mf2/2019/11/io8ln/", "title": "JWTs? JWKs? ‘kid’s? 'x5t's? Oh my!", "content_text": " \u0026amp;nbsp; JWTs? JWKs? ‘kid’s? \u0026amp;#39;x5t\u0026amp;#39;s? Oh my! \n", "content_html": "\n\n\u003cp\u003e\n\t\u003ci class=\"fa fa-bookmark\"\u003e\u003c/i\u003e\u0026nbsp;\n\t\u003ca class=\"p-name u-bookmark-of\" href=\"https://redthunder.blog/2017/06/08/jwts-jwks-kids-x5ts-oh-my/\"\u003e\n\t\t\n\t\tJWTs? JWKs? ‘kid’s? \u0026#39;x5t\u0026#39;s? Oh my!\n\t\t\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n\n\n\n\n\n", "summary": "", "image": "https://www.jvt.me/img/profile.png", "date_published": "2019-11-18T10:34:12+00:00","date_modifed": "2019-11-18T10:34:12+00:00","tags": ["jwt"] } ] } ```

When using feedparser (2.1.1) the feed is parsed successfully, even though https://json-feed-validator.herokuapp.com/validate shows it as an invalid format.

It would be good to validate the feed before reading it.

undefined method `rss_version' for nil:NilClass

FeedParser::Parser.parse('feeds.feedburner.com/GiantRobotsSmashingIntoOtherGiantRobots')

in rails console; the sub command gets error;
[debug] using stdlib rss/0.2.7
[debug] Parsing feed...
[debug] feed.class=NilClass
NoMethodError: undefined method rss_version' for nil:NilClass from /Users/farukcelik/.rvm/gems/ruby-2.1.0/gems/feedparser-1.0.0/lib/feedparser/builder/rss.rb:30:inbuild_feed' from /Users/farukcelik/.rvm/gems/ruby-2.1.0/gems/feedparser-1.0.0/lib/feedparser/builder/rss.rb:19:in initialize' from /Users/farukcelik/.rvm/gems/ruby-2.1.0/gems/feedparser-1.0.0/lib/feedparser/builder/rss.rb:14:innew' from /Users/farukcelik/.rvm/gems/ruby-2.1.0/gems/feedparser-1.0.0/lib/feedparser/builder/rss.rb:14:in build' from /Users/farukcelik/.rvm/gems/ruby-2.1.0/gems/feedparser-1.0.0/lib/feedparser/parser.rb:37:inparse' from /Users/farukcelik/.rvm/gems/ruby-2.1.0/gems/feedparser-1.0.0/lib/feedparser/parser.rb:12:in parse' from (irb):35 from /Users/farukcelik/.rvm/gems/ruby-2.1.0/gems/railties-4.1.7/lib/rails/commands/console.rb:90:instart'
from /Users/farukcelik/.rvm/gems/ruby-2.1.0/gems/railties-4.1.7/lib/rails/commands/console.rb:9:in start' from /Users/farukcelik/.rvm/gems/ruby-2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:69:inconsole'
from /Users/farukcelik/.rvm/gems/ruby-2.1.0/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:40:in run_command!' from /Users/farukcelik/.rvm/gems/ruby-2.1.0/gems/railties-4.1.7/lib/rails/commands.rb:17:in<top (required)>'
from bin/rails:8:in require' from bin/rails:8:in

'

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.