rfeedparser 0.9.85 → 0.9.86
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rfeedparser.rb +67 -66
- metadata +3 -3
data/lib/rfeedparser.rb
CHANGED
@@ -23,7 +23,7 @@ gem 'hpricot', ">=0.5"
|
|
23
23
|
gem 'character-encodings', ">=0.2.0"
|
24
24
|
gem 'htmltools', ">=1.10"
|
25
25
|
gem 'htmlentities', ">=4.0.0"
|
26
|
-
gem 'activesupport', ">=1.4.
|
26
|
+
gem 'activesupport', ">=1.4.1"
|
27
27
|
gem 'rchardet', ">=1.0"
|
28
28
|
|
29
29
|
require 'rchardet'
|
@@ -1061,7 +1061,7 @@ module Hpricot
|
|
1061
1061
|
end
|
1062
1062
|
|
1063
1063
|
module FeedParser
|
1064
|
-
Version = "0.
|
1064
|
+
Version = "0.9.86"
|
1065
1065
|
|
1066
1066
|
License = """Copyright (c) 2002-2006, Mark Pilgrim, All rights reserved.
|
1067
1067
|
|
@@ -3591,87 +3591,88 @@ class PprintSerializer < Serializer # FIXME ? use pp instead?
|
|
3591
3591
|
end
|
3592
3592
|
end
|
3593
3593
|
|
3594
|
-
|
3595
|
-
require 'optparse'
|
3596
|
-
require 'ostruct'
|
3597
|
-
options = OpenStruct.new
|
3598
|
-
options.etag = options.modified = options.agent = options.referrer = nil
|
3599
|
-
options.content_language = options.content_location = options.ctype = nil
|
3600
|
-
options.format = 'pprint'
|
3601
|
-
options.compatible = $compatible
|
3602
|
-
options.verbose = false
|
3603
|
-
|
3604
|
-
opts = OptionParser.new do |opts|
|
3605
|
-
|
3606
|
-
|
3607
|
-
|
3594
|
+
if $0 == __FILE__
|
3595
|
+
require 'optparse'
|
3596
|
+
require 'ostruct'
|
3597
|
+
options = OpenStruct.new
|
3598
|
+
options.etag = options.modified = options.agent = options.referrer = nil
|
3599
|
+
options.content_language = options.content_location = options.ctype = nil
|
3600
|
+
options.format = 'pprint'
|
3601
|
+
options.compatible = $compatible
|
3602
|
+
options.verbose = false
|
3603
|
+
|
3604
|
+
opts = OptionParser.new do |opts|
|
3605
|
+
opts.banner
|
3606
|
+
opts.separator ""
|
3607
|
+
opts.on("-A", "--user-agent [AGENT]",
|
3608
3608
|
"User-Agent for HTTP URLs") {|agent|
|
3609
|
-
|
3610
|
-
|
3609
|
+
options.agent = agent
|
3610
|
+
}
|
3611
3611
|
|
3612
|
-
|
3612
|
+
opts.on("-e", "--referrer [URL]",
|
3613
3613
|
"Referrer for HTTP URLs") {|referrer|
|
3614
|
-
|
3615
|
-
|
3614
|
+
options.referrer = referrer
|
3615
|
+
}
|
3616
3616
|
|
3617
|
-
|
3617
|
+
opts.on("-t", "--etag [TAG]",
|
3618
3618
|
"ETag/If-None-Match for HTTP URLs") {|etag|
|
3619
|
-
|
3620
|
-
|
3619
|
+
options.etag = etag
|
3620
|
+
}
|
3621
3621
|
|
3622
|
-
|
3622
|
+
opts.on("-m", "--last-modified [DATE]",
|
3623
3623
|
"Last-modified/If-Modified-Since for HTTP URLs (any supported date format)") {|modified|
|
3624
|
-
|
3625
|
-
|
3624
|
+
options.modified = modified
|
3625
|
+
}
|
3626
3626
|
|
3627
|
-
|
3627
|
+
opts.on("-f", "--format [FORMAT]", [:text, :pprint],
|
3628
3628
|
"output resutls in FORMAT (text, pprint)") {|format|
|
3629
|
-
|
3630
|
-
|
3629
|
+
options.format = format
|
3630
|
+
}
|
3631
3631
|
|
3632
|
-
|
3632
|
+
opts.on("-v", "--[no-]verbose",
|
3633
3633
|
"write debugging information to stderr") {|v|
|
3634
|
-
|
3635
|
-
|
3634
|
+
options.verbose = v
|
3635
|
+
}
|
3636
3636
|
|
3637
|
-
|
3637
|
+
opts.on("-c", "--[no-]compatible",
|
3638
3638
|
"strip element attributes like feedparser.py 4.1 (default)") {|comp|
|
3639
|
-
|
3640
|
-
|
3641
|
-
|
3639
|
+
options.compatible = comp
|
3640
|
+
}
|
3641
|
+
opts.on("-l", "--content-location [LOCATION]",
|
3642
3642
|
"default Content-Location HTTP header") {|loc|
|
3643
|
-
|
3644
|
-
|
3645
|
-
|
3643
|
+
options.content_location = loc
|
3644
|
+
}
|
3645
|
+
opts.on("-a", "--content-language [LANG]",
|
3646
3646
|
"default Content-Language HTTP header") {|lang|
|
3647
|
-
|
3648
|
-
|
3649
|
-
|
3647
|
+
options.content_language = lang
|
3648
|
+
}
|
3649
|
+
opts.on("-t", "--content-type [TYPE]",
|
3650
3650
|
"default Content-type HTTP header") {|ctype|
|
3651
|
-
|
3652
|
-
|
3653
|
-
end
|
3651
|
+
options.ctype = ctype
|
3652
|
+
}
|
3653
|
+
end
|
3654
3654
|
|
3655
|
-
opts.parse!(ARGV)
|
3656
|
-
$debug = true if options.verbose
|
3657
|
-
$compatible = options.compatible unless options.compatible.nil?
|
3655
|
+
opts.parse!(ARGV)
|
3656
|
+
$debug = true if options.verbose
|
3657
|
+
$compatible = options.compatible unless options.compatible.nil?
|
3658
3658
|
|
3659
|
-
if options.format == :text
|
3660
|
-
|
3661
|
-
else
|
3662
|
-
|
3663
|
-
end
|
3664
|
-
args = *ARGV.dup
|
3665
|
-
unless args.nil?
|
3666
|
-
|
3667
|
-
|
3668
|
-
|
3669
|
-
|
3670
|
-
|
3671
|
-
|
3672
|
-
|
3673
|
-
|
3674
|
-
|
3675
|
-
|
3659
|
+
if options.format == :text
|
3660
|
+
serializer = TextSerializer
|
3661
|
+
else
|
3662
|
+
serializer = PprintSerializer
|
3663
|
+
end
|
3664
|
+
args = *ARGV.dup
|
3665
|
+
unless args.nil?
|
3666
|
+
args.each do |url| # opts.parse! removes everything but the urls from the command line
|
3667
|
+
results = FeedParser.parse(url, :etag => options.etag,
|
3668
|
+
:modified => options.modified,
|
3669
|
+
:agent => options.agent,
|
3670
|
+
:referrer => options.referrer,
|
3671
|
+
:content_location => options.content_location,
|
3672
|
+
:content_language => options.content_language,
|
3673
|
+
:content_type => options.ctype
|
3674
|
+
)
|
3675
|
+
serializer.new(results).write($stdout)
|
3676
|
+
end
|
3676
3677
|
end
|
3677
3678
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rfeedparser
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.9.
|
7
|
-
date: 2007-04-
|
6
|
+
version: 0.9.86
|
7
|
+
date: 2007-04-05 00:00:00 -04:00
|
8
8
|
summary: Parse RSS and Atom feeds in Ruby
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -3423,7 +3423,7 @@ dependencies:
|
|
3423
3423
|
requirements:
|
3424
3424
|
- - ">="
|
3425
3425
|
- !ruby/object:Gem::Version
|
3426
|
-
version: 1.4.
|
3426
|
+
version: 1.4.1
|
3427
3427
|
version:
|
3428
3428
|
- !ruby/object:Gem::Dependency
|
3429
3429
|
name: hpricot
|