Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
898de33
Ignore Gemfile.lock
fudanchii Sep 15, 2013
c737c29
Allow http to https redirection, and add user-agent.
fudanchii Sep 15, 2013
f4fac1f
Updated README info.
damog Dec 7, 2013
da3a922
up to date
damog Dec 7, 2013
5e036e5
useless file
damog Dec 7, 2013
5170f7a
another useless file
damog Dec 7, 2013
317db5a
release date notice from two years ago
damog Dec 7, 2013
c8d3a48
0.9.2
damog Dec 7, 2013
0e6944a
Merge branch 'master' of https://github.com/dwillis/feedbag into dwil…
damog Dec 8, 2013
205261b
fixing the last bits of a bad merge :(
damog Dec 9, 2013
a1cbd28
fixed recurring 'ocurred' typo
konklone Apr 4, 2014
854b3c8
Merge pull request #4 from konklone/patch-1
damog Apr 4, 2014
7f4241f
finally fixed indentation
damog Aug 3, 2014
6bd7c7f
0.9.3
damog Aug 3, 2014
1b5ea41
adding gems
damog Aug 3, 2014
0c1e147
This little project has been around for a while now :)
damog Aug 3, 2014
eac1929
0.9.4
damog Aug 3, 2014
e5dd173
superfeedr proposal #1
damog Aug 12, 2014
af22161
Merge pull request #11 from damog/donation/superfeedr
damog Aug 25, 2014
bbabf00
fix nokogiri dependency version
jurgenwerk Oct 15, 2014
a214fc4
Merge pull request #12 from matixmatix/master
damog Oct 16, 2014
a73e98b
0.9.5
damog Oct 16, 2014
c676218
Remove redundant 'rdf' in looks_like_feed?
l3kn Dec 6, 2014
be8ec82
Merge pull request #13 from l3kn/patch-1
damog Dec 31, 2014
bc76dba
Fixed broken link
damog Nov 16, 2015
0c69ab4
Fix conflicts
fudanchii Feb 6, 2016
a35e130
Fix tests
fudanchii Feb 6, 2016
24e0ef4
Read html as binary first, then convert to utf8 explicitly
fudanchii Feb 6, 2016
44cd9f8
Require kconv
fudanchii Feb 6, 2016
1b15db9
Update readme
fudanchii Feb 6, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.swp
Gemfile.lock
*.gem
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2012 David Moreno <david@axiombox.com>
Copyright (C) 2008-2014 David Moreno <david@axiombox.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
14 changes: 14 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
* 0.9.4 - Sun Aug 3 13:51:09 CEST 2014
- Enhancements to the spec.
- Updated years on license notes

* 0.9.3 - Sun Aug 3 13:48:01 CEST 2014
- Rebuild of the gem to get rid of Hpricot.
- Appropriate build on Nokogiri.

* 0.9.2 - Sat Dec 7 18:32:17 CET 2013
- Up to date bits and pieces.

* 0.9.1 - Fri Mar 16 12:00:00 EDT 2012
- Small error on the release date.

* 0.9 - Fri Mar 16 10:59:00 EDT 2012
- Changed license to MIT.

Expand Down
32 changes: 0 additions & 32 deletions Gemfile.lock

This file was deleted.

90 changes: 22 additions & 68 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,97 +1,51 @@
Feedbag
=======

Feedbag is a Ruby library for the auto-discovery of syndicated feeds (RSS/Atom).
Yet another fork of Feedbag, Ruby's favorite auto-discovery tool/library!

### Quick synopsis

>> require "rubygems"
=> true
>> require "feedbag"
=> true
>> Feedbag.find "http://damog.nl/blog"
=> ["http://damog.net/blog/index.rss", "http://damog.net/blog/tags/feed", "http://damog.net/blog/tags/rfeed"]
>> Feedbag.feed?("google.com")
=> false
>> Feedbag.feed?("http://planet.debian.org/rss20.xml")
=> true
>> require "feedbag"
=> true
>> Feedbag.find "damog.net/blog"
=> ["http://damog.net/blog/index.rss", "http://damog.net/blog/tags/feed", "http://damog.net/blog/tags/rfeed"]
>> Feedbag.feed? "perl.org"
=> false
>> Feedbag.feed?("http://jobs.perl.org/rss/standard.rss")
=> true

### Installation

$ gem install feedbag
$ gem install feedbag

Or just grab feedbag.rb and use it on your own project:

$ wget http://github.com/damog/feedbag/raw/master/lib/feedbag.rb
$ wget http://github.com/damog/feedbag/raw/master/lib/feedbag.rb

## Tutorial
You can also use the command line tool for quick queries, if you install the gem:

So you want to know more about it.

OK, if the URL passed to the find method is a feed itself, that only feed URL will be returned.

>> Feedbag.find "github.com/damog.atom"
=> ["http://github.com/damog.atom"]
>>

Otherwise, it will always return LINK feeds first, A (anchor tags) feeds later. Between A feeds, the ones hosted on the same URL's host, will have larger priority:

>> Feedbag.find "http://ve.planetalinux.org"
=> ["http://feedproxy.google.com/PlanetaLinuxVenezuela", "http://rendergraf.wordpress.com/feed/", "http://rootweiller.wordpress.com/feed/", "http://skatox.com/blog/feed/", "http://kodegeek.com/atom.xml", "http://blog.0x29.com.ve/?feed=rss2&cat=8"]
>>

On your application you should only take the very first element of the array, most of the times:

>> Feedbag.find("planet.debian.org").first(3)
=> ["http://planet.debian.org/rss10.xml", "http://planet.debian.org/rss20.xml", "http://planet.debian.org/atom.xml"]
>>

(Try running that same example without the "first" method. That example's host is a blog aggregator, so it has hundreds of feed URLs:)

>> Feedbag.find("planet.debian.org").size
=> 104
>>

Feedbag will find them all, but it will return the most important ones on the first elements on the array returned.

>> Feedbag.find("cnn.com")
=> ["http://rss.cnn.com/rss/cnn_topstories.rss", "http://rss.cnn.com/rss/cnn_latest.rss", "http://rss.cnn.com/services/podcasting/robinmeade/rss.xml"]
>>
$ feedbag http://rubygems.org/profiles/damog
== http://rubygems.org/profiles/damog:
- http://feeds.feedburner.com/gemcutter-latest

### Why should you use it?

- Because it's cool.
- 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 rfeedfinder.

### Why did I build it?

- Because I liked Benjamin Trott's [Feed::Find](http://search.cpan.org/~btrott/Feed-Find-0.06/lib/Feed/Find.pm).
- Because I thought it would be good to have Feed::Find's functionality in Ruby.
- Because I thought it was going to be easy to maintain.
- Because I was going to use it on [rFeed](http://github.com/damog/rfeed).
- And finally, because I didn't know [rfeedfinder](http://rfeedfinder.rubyforge.org/) existed :-)

### Bugs

Please, report bugs to [rt@support.axiombox.com](rt@support.axiombox.com) or directly to the author.
### Why the fork?

### Contribute
This fork introduce one new dependency to support HTTP redirection flow. Another enhancement such as:

> git clone git://github.com/damog/feedbag.git
- Support for custom user agent, just set your preferred user agent from environment variable: `FEEDBAG_UA`
- Better encoding conversion, specifically for Japanese sites with non utf8 encoding.

...patch, build, hack and make pull requests. I'll be glad.

### Author
### Original Author

[David Moreno](http://damog.net/) <[david@axiombox.com](mailto:david@axiombox.com)>.

### Copyright

This is free software. See [COPYING](http://github.com/damog/feedbag/master/COPYING) for more information.

### Thanks

[Raquel](http://maggit.net), for making [Axiombox](http://axiombox.com) and most of my dreams possible. Also, [GitHub](http://github.com) for making a nice code sharing service that doesn't suck.

This is free software. See [COPYING](https://raw.githubusercontent.com/damog/feedbag/master/COPYING) for more information.
1 change: 0 additions & 1 deletion TODO

This file was deleted.

20 changes: 13 additions & 7 deletions feedbag.gemspec
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = %q{feedbag}
s.version = "0.9.1"
s.homepage = "http://axiombox.com/feedbag"
s.version = "0.9.5"
s.homepage = "http://github.com/damog/feedbag"
s.rubyforge_project = "feedbag"

s.authors = ["Axiombox", "David Moreno", "Derek Willis"]
s.date = %q{2012-03-16}
s.licenses = ["MIT"]

s.description = %q{Ruby's favorite feed auto-discoverty tool}
s.email = %q{david@axiombox.com}
s.extra_rdoc_files = ["README.markdown", "COPYING"]
s.files = ["lib/feedbag.rb", "benchmark/rfeedfinder_benchmark.rb", "bin/feedbag"]
s.has_rdoc = true
s.rdoc_options = ["--main", "README.markdown"]
s.summary = %q{Ruby's favorite feed auto-discovery tool}
s.add_dependency("nokogiri")
s.add_development_dependency "shoulda"
s.add_development_dependency "mocha", "~> 0.12.0"

s.add_dependency("nokogiri")
s.add_dependency("open_uri_redirections")

s.add_development_dependency "shoulda"
s.add_development_dependency "mocha", ">= 0.12.0"

s.bindir = 'bin'
s.default_executable = %q{feedbag}
s.executables = ["feedbag"]
Expand Down
115 changes: 0 additions & 115 deletions index.html

This file was deleted.

Loading