pauldix-feedzirra 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,7 +27,7 @@ module Feedzirra
27
27
  # === Returns
28
28
  # The class name of the parser that can handle the XML.
29
29
  def self.determine_feed_parser_for_xml(xml)
30
- start_of_doc = xml.slice(0, 1000)
30
+ start_of_doc = xml.slice(0, 2000)
31
31
  feed_classes.detect {|klass| klass.able_to_parse?(start_of_doc)}
32
32
  end
33
33
 
@@ -27,6 +27,11 @@ module Feedzirra
27
27
  element :updated
28
28
  element :modified, :as => :updated
29
29
  elements :category, :as => :categories, :value => :term
30
+ elements :link, :as => :links, :value => :href
31
+
32
+ def url
33
+ @url || links.first
34
+ end
30
35
  end
31
36
 
32
37
  end
data/lib/feedzirra.rb CHANGED
@@ -30,5 +30,5 @@ require 'feedzirra/parser/atom'
30
30
  require 'feedzirra/parser/atom_feed_burner'
31
31
 
32
32
  module Feedzirra
33
- VERSION = "0.0.15"
33
+ VERSION = "0.0.16"
34
34
  end
@@ -15,6 +15,10 @@ describe Feedzirra::Parser::AtomEntry do
15
15
  @entry.url.should == "http://aws.typepad.com/aws/2009/01/aws-job-architect-designer-position-in-turkey.html"
16
16
  end
17
17
 
18
+ it "should parse the url even when" do
19
+ Feedzirra::Parser::Atom.parse(load_sample("atom_with_link_tag_for_url_unmarked.xml")).entries.first.url.should == "http://www.innoq.com/blog/phaus/2009/07/ja.html"
20
+ end
21
+
18
22
  it "should parse the author" do
19
23
  @entry.author.should == "AWS Editor"
20
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pauldix-feedzirra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Dix