Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/damog/feedbag
Ruby's favorite feed auto-discovery library/tool
https://github.com/damog/feedbag
atom atom-feed autodiscovery feed feeds rss rss-feed ruby
Last synced: 3 months ago
JSON representation
Ruby's favorite feed auto-discovery library/tool
- Host: GitHub
- URL: https://github.com/damog/feedbag
- Owner: damog
- License: mit
- Created: 2008-12-16T01:41:59.000Z (about 16 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T01:15:42.000Z (almost 2 years ago)
- Last Synced: 2024-10-04T22:05:33.057Z (4 months ago)
- Topics: atom, atom-feed, autodiscovery, feed, feeds, rss, rss-feed, ruby
- Language: Ruby
- Homepage:
- Size: 104 KB
- Stars: 133
- Watchers: 7
- Forks: 42
- Open Issues: 3
-
Metadata Files:
- Readme: README.markdown
- Changelog: ChangeLog
- License: COPYING
Awesome Lists containing this project
README
Feedbag
=======Feedbag is Ruby's favorite auto-discovery tool/library!
### Quick synopsis
```ruby
>> require "feedbag"
=> true
>> Feedbag.find "damog.net/blog"
=> ["http://damog.net/blog/atom.xml"]
>> Feedbag.feed? "perl.org"
=> false
>> Feedbag.feed?("https://m.signalvnoise.com/feed")
=> true
```### Installation
$ gem install feedbag
Or just grab feedbag.rb and use it on your own project:
$ wget https://raw.githubusercontent.com/damog/feedbag/master/lib/feedbag.rb
You can also use the command line tool for quick queries, if you install the gem:
» feedbag https://www.ruby-lang.org/en/
== https://www.ruby-lang.org/en/:
- https://www.ruby-lang.org/en/feeds/news.rss
### Usage
Feedbag will find all RSS feed types. Here's an example of finding ATOM and JSON Feed```ruby
> Feedbag.find('https://daringfireball.net')
=> ["https://daringfireball.net/feeds/main", "https://daringfireball.net/feeds/json", "https://daringfireball.net/linked/2021/02/17/bookfeed"]
```Feedbag defaults to a User-Agent string of **Feedbag/1.10.2**, however you can override this
```ruby
0> Feedbag.find('https://kottke.org', 'User-Agent' => "My Personal Agent/1.0.1")
=> ["http://feeds.kottke.org/main", "http://feeds.kottke.org/json"]
````The other options passed to find, will be passed to OpenURI. For example:
```ruby
Feedbag.find("https://kottke.org", 'User-Agent' => "My Personal Agent/1.0.1", open_timeout: 1000)
```You can find the other options to OpenURI [here](https://rubyapi.org/o/openuri/openread#method-i-open).
### Why should you use it?
- Because it only uses [Nokogiri](http://nokogiri.org/) as dependency.
- Because it follows modern feed filename conventions (like those ones used by WordPress blogs, or Blogger, etc).
- Because it's a single file you can embed easily in your application.
- Because it's faster than anything else.### Author
[David Moreno](http://damog.net/) <[[email protected]](mailto:[email protected])>.
### Donations
![Superfeedr](https://raw.githubusercontent.com/damog/feedbag/master/img/superfeedr_150.png)
[Superfeedr](http://superfeedr.com) has kindly financially [supported](https://github.com/damog/feedbag/issues/9) the development of Feedbag.
### Copyright
This is and will always be free software. See [COPYING](https://raw.githubusercontent.com/damog/feedbag/master/COPYING) for more information.