feedjira 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -1
- data/lib/feedjira/parser/atom.rb +10 -8
- data/lib/feedjira/parser/itunes_rss.rb +1 -1
- data/lib/feedjira/version.rb +1 -1
- data/spec/feedjira/parser/atom_spec.rb +15 -1
- data/spec/feedjira/parser/itunes_rss_spec.rb +4 -0
- data/spec/sample_feeds.rb +1 -0
- data/spec/sample_feeds/FeedjiraBlog.xml +86 -0
- data/spec/sample_feeds/itunes.xml +1 -0
- metadata +4 -17
- data/benchmarks/README.md +0 -90
- data/benchmarks/basic.rb +0 -31
- data/benchmarks/feed_list.txt +0 -10
- data/benchmarks/feed_xml/apple.xml +0 -149
- data/benchmarks/feed_xml/cnn.xml +0 -278
- data/benchmarks/feed_xml/daring_fireball.xml +0 -1697
- data/benchmarks/feed_xml/engadget.xml +0 -604
- data/benchmarks/feed_xml/feedjira_commits.xml +0 -370
- data/benchmarks/feed_xml/gizmodo.xml +0 -2
- data/benchmarks/feed_xml/loop.xml +0 -441
- data/benchmarks/feed_xml/rails.xml +0 -1938
- data/benchmarks/feed_xml/white_house.xml +0 -951
- data/benchmarks/feed_xml/xkcd.xml +0 -2
- data/benchmarks/fetching_systems.rb +0 -23
- data/benchmarks/other_libraries.rb +0 -73
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4bfa9a3ad56ca78ba82d37207e69ca4e12c8ee5
|
4
|
+
data.tar.gz: 5755201822491bd1f77cecb532ee9fc182bd0b42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c6539c549c742cd555d1f9b2c2c4c88eef74e7bca45c1abad55af1efb8b6fd9028973194841762090f2cc34ab87532632e0d9fc729f84edd6b076e33c9b20d5
|
7
|
+
data.tar.gz: 6e3fd5625766907bdbd6b4355ac56f4b6a18135bd0f42eb005c8616d111811024326bf3679e33e31753a1fed210a10d1c8aa387f93b8a223dfaccd43aafc1343
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
# Feedjira Changelog
|
2
2
|
|
3
|
+
## 1.2.0
|
4
|
+
|
5
|
+
* General
|
6
|
+
* Benchmarks have been moved to [feedjira-benchmarks][bench]
|
7
|
+
|
8
|
+
* Enhancements
|
9
|
+
* For Atom feeds, use self link for `feed_url` [#212][] [#213][]
|
10
|
+
* For Atom feeds, don't use self link for `url` [#212][] [#213][]
|
11
|
+
|
12
|
+
* Bug fixes
|
13
|
+
* Remove div that wraps xhtml content in Atom feeds [#214][]
|
14
|
+
* Properly parse itunes:new-feed-url [#217][]
|
15
|
+
|
16
|
+
[bench]: https://github.com/feedjira/feedjira-benchmarks
|
17
|
+
[#212]: https://github.com/feedjira/feedjira/issues/212
|
18
|
+
[#213]: https://github.com/feedjira/feedjira/pull/213
|
19
|
+
[#214]: https://github.com/feedjira/feedjira/issues/214
|
20
|
+
[#217]: https://github.com/feedjira/feedjira/pull/217
|
21
|
+
|
3
22
|
## 1.1.0
|
4
23
|
|
5
24
|
* General
|
@@ -26,7 +45,7 @@
|
|
26
45
|
|
27
46
|
## 0.7.1
|
28
47
|
|
29
|
-
*
|
48
|
+
* Bug fixes
|
30
49
|
* Don't use entry id for updating when feed doesn't provide it [#205][]
|
31
50
|
|
32
51
|
[#205]: https://github.com/feedjira/feedjira/pull/205
|
data/lib/feedjira/parser/atom.rb
CHANGED
@@ -7,7 +7,7 @@ module Feedjira
|
|
7
7
|
element :title
|
8
8
|
element :subtitle, :as => :description
|
9
9
|
element :link, :as => :url, :value => :href, :with => {:type => "text/html"}
|
10
|
-
element :link, :as => :feed_url, :value => :href, :with => {:
|
10
|
+
element :link, :as => :feed_url, :value => :href, :with => {:rel => "self"}
|
11
11
|
elements :link, :as => :links, :value => :href
|
12
12
|
elements :link, :as => :hubs, :value => :href, :with => {:rel => "hub"}
|
13
13
|
elements :entry, :as => :entries, :class => AtomEntry
|
@@ -17,7 +17,7 @@ module Feedjira
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def url
|
20
|
-
@url || links.last
|
20
|
+
@url || (links - [feed_url]).last || links.last
|
21
21
|
end
|
22
22
|
|
23
23
|
def feed_url
|
@@ -34,26 +34,28 @@ module Feedjira
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def to_xml
|
37
|
-
|
37
|
+
process_content
|
38
38
|
doc.to_xml
|
39
39
|
end
|
40
40
|
|
41
41
|
private
|
42
42
|
|
43
|
-
def
|
44
|
-
|
43
|
+
def process_content
|
44
|
+
content_nodes.each do |node|
|
45
|
+
node.content = raw_html(node) unless node.cdata?
|
46
|
+
end
|
45
47
|
end
|
46
48
|
|
47
|
-
def
|
49
|
+
def content_nodes
|
48
50
|
doc.search 'entry > content[type="xhtml"]'
|
49
51
|
end
|
50
52
|
|
51
53
|
def raw_html(node)
|
52
|
-
CGI.unescape_html node.inner_html
|
54
|
+
CGI.unescape_html node.search('div').inner_html
|
53
55
|
end
|
54
56
|
|
55
57
|
def doc
|
56
|
-
@doc ||= Nokogiri::XML
|
58
|
+
@doc ||= Nokogiri::XML(@xml).remove_namespaces!
|
57
59
|
end
|
58
60
|
end
|
59
61
|
end
|
@@ -24,7 +24,7 @@ module Feedjira
|
|
24
24
|
element :"itunes:explicit", :as => :itunes_explicit
|
25
25
|
element :"itunes:keywords", :as => :itunes_keywords
|
26
26
|
# New URL for the podcast feed
|
27
|
-
element :"itunes:
|
27
|
+
element :"itunes:new_feed_url", :as => :itunes_new_feed_url
|
28
28
|
element :"itunes:subtitle", :as => :itunes_subtitle
|
29
29
|
# If summary is not present, use the description tag
|
30
30
|
element :"itunes:summary", :as => :itunes_summary
|
data/lib/feedjira/version.rb
CHANGED
@@ -70,7 +70,21 @@ describe Feedjira::Parser::Atom do
|
|
70
70
|
feed = Feedjira::Parser::Atom.parse sample_atom_xhtml_feed
|
71
71
|
entry = feed.entries.first
|
72
72
|
|
73
|
-
entry.content.should match
|
73
|
+
entry.content.should match /\A\<p/
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe "parsing url and feed url based on rel attribute" do
|
78
|
+
before :each do
|
79
|
+
@feed = Feedjira::Parser::Atom.parse(sample_atom_middleman_feed)
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should parse url" do
|
83
|
+
@feed.url.should == "http://feedjira.com/blog"
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should parse feed url" do
|
87
|
+
@feed.feed_url.should == "http://feedjira.com/blog/feed.xml"
|
74
88
|
end
|
75
89
|
end
|
76
90
|
end
|
data/spec/sample_feeds.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module SampleFeeds
|
2
2
|
FEEDS = {
|
3
3
|
sample_atom_feed: "AmazonWebServicesBlog.xml",
|
4
|
+
sample_atom_middleman_feed: "FeedjiraBlog.xml",
|
4
5
|
sample_atom_xhtml_feed: "pet_atom.xml",
|
5
6
|
sample_atom_feed_line_breaks: "AtomFeedWithSpacesAroundEquals.xml",
|
6
7
|
sample_atom_entry_content: "AmazonWebServicesBlogFirstEntryContent.xml",
|
@@ -0,0 +1,86 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<feed xmlns="http://www.w3.org/2005/Atom">
|
3
|
+
<title>Feedjira Blog</title>
|
4
|
+
<subtitle>A Blog for Feedjira</subtitle>
|
5
|
+
<id>http://feedjira.com/blog</id>
|
6
|
+
<link href="http://feedjira.com/blog"/>
|
7
|
+
<link href="http://feedjira.com/blog/feed.xml" rel="self"/>
|
8
|
+
<updated>2014-03-17T00:00:00Z</updated>
|
9
|
+
<author>
|
10
|
+
<name>Jon Allured</name>
|
11
|
+
</author>
|
12
|
+
<entry>
|
13
|
+
<title>Feedjira Goes One-Point-Oh</title>
|
14
|
+
<link rel="alternate" href="http://feedjira.com/blog/2014/03/17/feedjira-goes-one-point-oh.html"/>
|
15
|
+
<id>http://feedjira.com/blog/2014/03/17/feedjira-goes-one-point-oh.html</id>
|
16
|
+
<published>2014-03-17T00:00:00Z</published>
|
17
|
+
<updated>2014-03-17T08:02:45-05:00</updated>
|
18
|
+
<author>
|
19
|
+
<name>Jon Allured</name>
|
20
|
+
</author>
|
21
|
+
<content type="html"><p>Last fall, I asked <a href="http://www.pauldix.net">Paul Dix</a> if I could take over maintenance of his gem
|
22
|
+
Feedzirra. My request was totally out of the blue, so I was pretty pumped when
|
23
|
+
he got right back to me and said yes. He said that he didn&rsquo;t have time to work
|
24
|
+
on it anymore and so I should feel free to do whatever I thought was best.</p>
|
25
|
+
|
26
|
+
<p>Score!</p>
|
27
|
+
|
28
|
+
<p>My first order of business was to go through the many open issues and pull
|
29
|
+
requests on GitHub. When I started there were over 60, a number that I&rsquo;ve gotten
|
30
|
+
down to just a few. I thought it was important to ensure that users saw me treat
|
31
|
+
their issue as important and even if it was very old (which many were), I asked
|
32
|
+
if there was anything I could do to help.</p>
|
33
|
+
|
34
|
+
<p>I was pleasantly surprised by the nice way many people responded and we got to
|
35
|
+
work addressing their questions and issues.</p>
|
36
|
+
|
37
|
+
<p>As I was working through issues and pull requests, I kept <a href="http://semver.org">SemVer</a> in mind -
|
38
|
+
bug fixes in patch releases and backward-compatible changes in minor releases.
|
39
|
+
But I also realized that it was past time for this project to be at version 1.0.
|
40
|
+
In the SemVer FAQ, they talk about when to release version 1.0 and Feedzirra fit
|
41
|
+
the bill: it was being used in production, there was a stable API and I was
|
42
|
+
taking backwards compatibilty seriously.</p>
|
43
|
+
|
44
|
+
<p>So I treated it as a project at 1.0 and I did my best to release versions that
|
45
|
+
were backward compatible and added deprecations for what I wanted to do in 1.0.
|
46
|
+
I saw things that I wanted to completely rewrite, but I resisted the urge to
|
47
|
+
burn it all down and start again.</p>
|
48
|
+
|
49
|
+
<p>When I was close to being caught up on the backlog of issues and pull requests,
|
50
|
+
I started thinking about releasing version 1.0, and I knew I wanted to create a
|
51
|
+
website for the project. I worked with <a href="http://danielariza.com">Daniel Ariza</a> to make it happen. I
|
52
|
+
ripped apart the README and rewrote just about all the sections.</p>
|
53
|
+
|
54
|
+
<p>There was an open issue on the project about renaming the Gem and I knew that
|
55
|
+
launching the website and releasing 1.0 would be the perfect opportunity, so I
|
56
|
+
went for it. There was a suggestion to change the name to Feedzilla, but since
|
57
|
+
that is already a thing, I went with Feedjira. I bought the domain and setup an
|
58
|
+
organization by that name on GitHub.</p>
|
59
|
+
|
60
|
+
<p>With those things in place, I needed to actually update the code for these
|
61
|
+
changes. I wanted to make this transition as easy as possible and devised a
|
62
|
+
simple way to use <a href="/versions.html">three versions</a> to make the jump to 1.0.</p>
|
63
|
+
|
64
|
+
<p>For most users, upgrading to 1.0 should be a breeze, but I have an <a href="/upgrading.html">upgrade
|
65
|
+
page</a> to help with a couple details. If you have any trouble upgrading,
|
66
|
+
please let me know by <a href="https://github.com/feedjira/feedjira/issues">opening an issue</a>.</p>
|
67
|
+
|
68
|
+
<p>There are still lots of things I&rsquo;d like to do with this Gem. I mentioned seeing
|
69
|
+
things that I wanted to completely rewrite, so that&rsquo;ll be something that I work
|
70
|
+
on for a 2.0 release, but that&rsquo;s a ways off. I&rsquo;d like to officially support
|
71
|
+
JRuby. Many people use Feedjira with Rails, so a separate project that helps
|
72
|
+
those users get up and running quickly seems to have value.</p>
|
73
|
+
|
74
|
+
<p>The list goes on.</p>
|
75
|
+
|
76
|
+
<p>I do have a request before I finish this thing: I&rsquo;d like to hear from users that
|
77
|
+
have apps in production using Feedjira. If you&rsquo;re using Feedjira for a
|
78
|
+
commercial app, please <a href="feedjira@gmail.com">email me</a>!</p>
|
79
|
+
|
80
|
+
<p>Thanks to everyone who has helped me accomplish this, but especially <a href="http://www.pauldix.net">Paul
|
81
|
+
Dix</a> for creating such a fun project to work on, <a href="http://danielariza.com">Daniel Ariza</a> for a
|
82
|
+
badass website design and the many people who opened issues or sent pull
|
83
|
+
requests. Open source is fun to work on because of people like you!! &lt;3 &lt;3 &lt;3</p>
|
84
|
+
</content>
|
85
|
+
</entry>
|
86
|
+
</feed>
|
@@ -8,6 +8,7 @@
|
|
8
8
|
<language>en-us</language>
|
9
9
|
<copyright>℗ & © 2005 John Doe & Family</copyright>
|
10
10
|
<itunes:subtitle>A show about everything</itunes:subtitle>
|
11
|
+
<itunes:new-feed-url>http://example.com/new.xml</itunes:new-feed-url>
|
11
12
|
<itunes:author>John Doe</itunes:author>
|
12
13
|
<itunes:summary>All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the iTunes Music Store</itunes:summary>
|
13
14
|
<description>All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the iTunes Music Store</description>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feedjira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Dix
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-
|
14
|
+
date: 2014-04-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: sax-machine
|
@@ -83,21 +83,6 @@ files:
|
|
83
83
|
- LICENSE
|
84
84
|
- README.md
|
85
85
|
- Rakefile
|
86
|
-
- benchmarks/README.md
|
87
|
-
- benchmarks/basic.rb
|
88
|
-
- benchmarks/feed_list.txt
|
89
|
-
- benchmarks/feed_xml/apple.xml
|
90
|
-
- benchmarks/feed_xml/cnn.xml
|
91
|
-
- benchmarks/feed_xml/daring_fireball.xml
|
92
|
-
- benchmarks/feed_xml/engadget.xml
|
93
|
-
- benchmarks/feed_xml/feedjira_commits.xml
|
94
|
-
- benchmarks/feed_xml/gizmodo.xml
|
95
|
-
- benchmarks/feed_xml/loop.xml
|
96
|
-
- benchmarks/feed_xml/rails.xml
|
97
|
-
- benchmarks/feed_xml/white_house.xml
|
98
|
-
- benchmarks/feed_xml/xkcd.xml
|
99
|
-
- benchmarks/fetching_systems.rb
|
100
|
-
- benchmarks/other_libraries.rb
|
101
86
|
- feedjira.gemspec
|
102
87
|
- lib/feedjira.rb
|
103
88
|
- lib/feedjira/core_ext.rb
|
@@ -143,6 +128,7 @@ files:
|
|
143
128
|
- spec/sample_feeds/AmazonWebServicesBlogFirstEntryContent.xml
|
144
129
|
- spec/sample_feeds/AtomFeedWithSpacesAroundEquals.xml
|
145
130
|
- spec/sample_feeds/FeedBurnerUrlNoAlternate.xml
|
131
|
+
- spec/sample_feeds/FeedjiraBlog.xml
|
146
132
|
- spec/sample_feeds/GoogleDocsList.xml
|
147
133
|
- spec/sample_feeds/HREFConsideredHarmful.xml
|
148
134
|
- spec/sample_feeds/HREFConsideredHarmfulFirstEntry.xml
|
@@ -209,6 +195,7 @@ test_files:
|
|
209
195
|
- spec/sample_feeds/AmazonWebServicesBlogFirstEntryContent.xml
|
210
196
|
- spec/sample_feeds/AtomFeedWithSpacesAroundEquals.xml
|
211
197
|
- spec/sample_feeds/FeedBurnerUrlNoAlternate.xml
|
198
|
+
- spec/sample_feeds/FeedjiraBlog.xml
|
212
199
|
- spec/sample_feeds/GoogleDocsList.xml
|
213
200
|
- spec/sample_feeds/HREFConsideredHarmful.xml
|
214
201
|
- spec/sample_feeds/HREFConsideredHarmfulFirstEntry.xml
|
data/benchmarks/README.md
DELETED
@@ -1,90 +0,0 @@
|
|
1
|
-
# Feedjira Benchmarks
|
2
|
-
|
3
|
-
Speed is an important feature of Feedjira and we use benchmarks to ensure we're
|
4
|
-
fast and we stay that way.
|
5
|
-
|
6
|
-
## Fetching Options
|
7
|
-
|
8
|
-
One way Feedjira achieves its speed is by fetching feeds in parallel. This
|
9
|
-
benchmark compares ways to fetch feed urls:
|
10
|
-
|
11
|
-
```
|
12
|
-
user system total real
|
13
|
-
Net::HTTP 0.310000 0.110000 0.420000 ( 10.111994)
|
14
|
-
Curl::Easy 0.140000 0.260000 0.400000 ( 14.692383)
|
15
|
-
Curl::Multi 0.100000 0.170000 0.270000 ( 3.334533)
|
16
|
-
```
|
17
|
-
|
18
|
-
See the [fetching systems code][fetching_systems] for more details.
|
19
|
-
|
20
|
-
[fetching_systems]: https://github.com/feedjira/feedjira/blob/master/benchmarks/fetching_systems.rb
|
21
|
-
|
22
|
-
## Basic Benchmarks
|
23
|
-
|
24
|
-
The basics to using Feedjira are the `parse`, `fetch_and_parse` and `update`
|
25
|
-
methods, so this benchmark compares them:
|
26
|
-
|
27
|
-
```
|
28
|
-
user system total real
|
29
|
-
parse 1.500000 0.010000 1.510000 ( 1.498793)
|
30
|
-
fetch_and_parse 2.230000 0.310000 2.540000 ( 12.212616)
|
31
|
-
update 1.030000 0.270000 1.300000 ( 29.359274)
|
32
|
-
```
|
33
|
-
|
34
|
-
See the [basic benchmark code][basic] for more details.
|
35
|
-
|
36
|
-
[basic]: https://github.com/feedjira/feedjira/blob/master/benchmarks/basic.rb
|
37
|
-
|
38
|
-
## Other Libraries
|
39
|
-
|
40
|
-
This benchmark compares various alternatives to Feedjira. As of 11/29/13, these
|
41
|
-
are the top 10 gems in the [Atom & RSS Feed Parsing category][alternatives] on
|
42
|
-
Ruby Toolbox:
|
43
|
-
|
44
|
-
[alternatives]: https://www.ruby-toolbox.com/categories/feed_parsing
|
45
|
-
|
46
|
-
* Feedjira
|
47
|
-
* Simple-rss
|
48
|
-
* Feed-normalizer
|
49
|
-
* Ratom
|
50
|
-
* Rfeedparser
|
51
|
-
* FeedParser
|
52
|
-
* Feed me
|
53
|
-
* Feedtosis
|
54
|
-
* Ruby-feedparser
|
55
|
-
* Opds
|
56
|
-
|
57
|
-
Only some of these are still under active deveopment and still others aren't a
|
58
|
-
good fit for this type of benchmark comparison. Notes on those that were left
|
59
|
-
out:
|
60
|
-
|
61
|
-
* Ratom => only supports Atom
|
62
|
-
* Rfeedparser => can't install, depends on hpricot v0.6
|
63
|
-
* Feedtosis => can't install, unresolved dependencies
|
64
|
-
* Opds => aimed at OPDS specifically
|
65
|
-
|
66
|
-
The remaining alternatives are benchmarked in two ways. The parsing benchmarks
|
67
|
-
just take raw XML and throw it at the library. Those that can also fetch, have a
|
68
|
-
second benchmark for that work.
|
69
|
-
|
70
|
-
Note: both FeedParser and Ruby-feedparser use the `FeedParser` namespace, so
|
71
|
-
their benchmarks can't be run at the same time.
|
72
|
-
|
73
|
-
```
|
74
|
-
Parsing benchmarks
|
75
|
-
user system total real
|
76
|
-
feedjira 1.560000 0.000000 1.560000 ( 1.573555)
|
77
|
-
simple-rss 43.140000 0.150000 43.290000 ( 43.421603)
|
78
|
-
feed-normalizer 39.870000 0.130000 40.000000 ( 40.404832)
|
79
|
-
feed_parser 0.240000 0.000000 0.240000 ( 0.249771)
|
80
|
-
feed_me 0.220000 0.010000 0.230000 ( 0.229034)
|
81
|
-
|
82
|
-
Fetch and parse benchmarks
|
83
|
-
user system total real
|
84
|
-
feedjira 2.250000 0.320000 2.570000 ( 11.224833)
|
85
|
-
feed_parser 1.700000 0.290000 1.990000 ( 28.941270)
|
86
|
-
```
|
87
|
-
|
88
|
-
See the [other benchmark code][other_benchmark] for more details.
|
89
|
-
|
90
|
-
[other_benchmark]: https://github.com/feedjira/feedjira/blob/master/benchmarks/other_libraries.rb
|
data/benchmarks/basic.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../lib/feedjira')
|
2
|
-
|
3
|
-
require 'benchmark'
|
4
|
-
|
5
|
-
iterations = 10
|
6
|
-
urls = File.readlines(File.dirname(__FILE__) + '/feed_list.txt')
|
7
|
-
files = Dir.glob(File.dirname(__FILE__) + '/feed_xml/*.xml')
|
8
|
-
xmls = files.map { |file| File.open(file).read }
|
9
|
-
feeds = Feedjira::Feed.fetch_and_parse(urls).values
|
10
|
-
|
11
|
-
Benchmark.bm(15) do |b|
|
12
|
-
b.report('parse') do
|
13
|
-
iterations.times do
|
14
|
-
xmls.each { |xml| Feedjira::Feed.parse xml }
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
b.report('fetch_and_parse') do
|
19
|
-
iterations.times { Feedjira::Feed.fetch_and_parse urls }
|
20
|
-
end
|
21
|
-
|
22
|
-
# curb caches the DNS lookups for 60 seconds, so to make things fair we have
|
23
|
-
# to wait for the cache to expire
|
24
|
-
65.times { sleep 1 }
|
25
|
-
|
26
|
-
b.report('update') do
|
27
|
-
iterations.times do
|
28
|
-
feeds.each { |feed| Feedjira::Feed.update feed }
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
data/benchmarks/feed_list.txt
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
http://daringfireball.net/index.xml
|
2
|
-
http://feeds.gawker.com/gizmodo/full
|
3
|
-
http://images.apple.com/main/rss/hotnews/hotnews.rss
|
4
|
-
http://rss.cnn.com/rss/cnn_topstories.rss
|
5
|
-
http://weblog.rubyonrails.org/feed/atom.xml
|
6
|
-
http://www.engadget.com/rss.xml
|
7
|
-
http://www.loopinsight.com/feed/
|
8
|
-
http://www.whitehouse.gov/feed/blog/white-house
|
9
|
-
http://xkcd.com/atom.xml
|
10
|
-
https://github.com/feedjira/feedjira/commits/master.atom
|