ProductPromotion
Logo

Ruby

made by https://0x3d.site

GitHub - feedjira/feedjira: A feed parsing library
A feed parsing library. Contribute to feedjira/feedjira development by creating an account on GitHub.
Visit Site

GitHub - feedjira/feedjira: A feed parsing library

GitHub - feedjira/feedjira: A feed parsing library

Feedjira

Build Status Code Climate

Feedjira is a Ruby library designed to parse feeds.

Installation

Add this line to your application's Gemfile:

gem "feedjira"

Parsing

An example of parsing a feed with Feedjira:

xml = HTTParty.get(url).body
feed = Feedjira.parse(xml)
feed.entries.first.title
# => "Announcing version 3.0"

Specifying parser

If you have the XML and just want to provide a parser class for one parse, you can specify that using parse with the parser option:

Feedjira.parse(xml, parser: MyAwesomeParser)

Adding attributes to all feeds types / all entries types

# Add the generator attribute to all feed types
Feedjira::Feed.add_common_feed_element("generator")
xml = HTTParty.get("http://www.pauldix.net/atom.xml").body
Feedjira.parse(xml).generator
# => "TypePad"

Adding attributes to only one class

If you want to add attributes for only one class you simply have to declare them in the class

# Add some GeoRss information
class Feedjira::Parser::RSSEntry
  element "georss:elevation", as: :elevation
end

# Fetch a feed containing GeoRss info and print them
url = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_week.atom"
xml = HTTParty.get(url).body
Feedjira.parse(xml).entries.each do |entry|
  puts "Elevation: #{entry.elevation}"
end

Configuration

Parsers

Adding a custom parser

You can insert your own parser at the front of the available parser list by:

Feedjira.configure do |config|
  config.parsers.unshift(MyAwesomeParser)
end

Now when you call Feedjira.parse, MyAwesomeParser will be the first one to get a chance to parse the feed.

Explicitly set all available parsers

Feedjira can be configured to use a specific set of parsers and in a specific order:

Feedjira.configure do |config|
  config.parsers = [
    Feedjira::Parser::ITunesRSS,
    MyAwesomeParser,
    Feedjira::Parser::RSS
  ]
end

Stripping whitespace from XML

Feedjira can be configured to strip all whitespace but defaults to lstrip only:

Feedjira.configure do |config|
  config.strip_whitespace = true
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/feedjira/feedjira. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Projects that use Feedjira

Feedjira is used in some awesome projects around the web - from RSS readers to add-ons and everything in between. Here are some of them:

  • Feedbin: Feedbin bills itself as a fast, simple RSS reader that delivers a great reading experience. It's a paid RSS reader that integrates with mobile apps and it even has a fully featured API!

  • Stringer: Stringer is a self-hosted, anti-social RSS reader. It's an open-source project that's easy to deploy to any host, there's even a one-click button to deploy on Heroku.

  • BlogFeeder: BlogFeeder is a paid Shopify App that makes it easy for you to import any external blog into your Shopify store. It helps improve your store's SEO and keeps your blogs in sync, plus a lot more.

  • Feedbunch: Feedbunch is an open source feed reader built to fill the hole left by Google Reader. It aims to support all features of Google Reader and actually improve on others.

  • The Old Reader: The Old Reader advertises as the ultimate social RSS reader. It's free to start and also has a paid premium version. There's an API and it integrates with many different mobile apps.

  • Solve for All: Solve for All combines search engine and feed parsing while protecting your privacy. It's even extendable by the community!

  • Feedi API: Feedi simplifies how you handle RSS, Atom, or JSON feeds. You can add and keep track of your favourite feed data with a simple and clean REST API. All entries are enriched by Machine Learning and Semantic engines.

  • Breaker: The social podcast app

  • Huginn: Huginn is a system for building agents that perform automated tasks for you online.

Note: to get your project on this list, simply send an email with your project's details.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory