feedtools 0.2.18 → 0.2.19
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +28 -0
- data/lib/feed_tools.rb +328 -63
- data/lib/feed_tools/feed.rb +767 -764
- data/lib/feed_tools/feed_item.rb +684 -625
- data/lib/feed_tools/helpers/debug_helper.rb +37 -0
- data/lib/feed_tools/helpers/feed_tools_helper.rb +45 -41
- data/lib/feed_tools/helpers/generic_helper.rb +164 -0
- data/lib/feed_tools/helpers/retrieval_helper.rb +36 -0
- data/rakefile +298 -2
- data/test/unit/amp_test.rb +70 -69
- data/test/unit/atom_test.rb +91 -9
- data/test/unit/cache_test.rb +30 -11
- data/test/unit/cdf_test.rb +6 -4
- data/test/unit/encoding_test.rb +99 -0
- data/test/unit/generation_test.rb +3 -40
- data/test/unit/helper_test.rb +66 -6
- data/test/unit/interface_test.rb +34 -0
- data/test/unit/itunes_test.rb +19 -0
- data/test/unit/nonstandard_test.rb +22 -4
- data/test/unit/rdf_test.rb +19 -0
- data/test/unit/rss_test.rb +137 -43
- metadata +18 -8
- data/lib/feed_tools/vendor/builder.rb +0 -15
- data/lib/feed_tools/vendor/builder/blankslate.rb +0 -55
- data/lib/feed_tools/vendor/builder/xmlbase.rb +0 -144
- data/lib/feed_tools/vendor/builder/xmlevents.rb +0 -65
- data/lib/feed_tools/vendor/builder/xmlmarkup.rb +0 -299
@@ -0,0 +1,37 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2005 Robert Aman
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
module FeedTools
|
25
|
+
module DebugHelper
|
26
|
+
# Forces a stack_trace without interfering with the program
|
27
|
+
def stack_trace
|
28
|
+
|
29
|
+
fork do
|
30
|
+
ObjectSpace.each_object(Thread) do |th|
|
31
|
+
th.raise Exception, "Stack Dump" unless Thread.current == th
|
32
|
+
end
|
33
|
+
raise Exception, "Stack Dump"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
#--
|
2
2
|
# Copyright (c) 2005 Robert Aman
|
3
3
|
#
|
4
|
+
# Contributors: Jens Kraemer
|
5
|
+
#
|
4
6
|
# Permission is hereby granted, free of charge, to any person obtaining
|
5
7
|
# a copy of this software and associated documentation files (the
|
6
8
|
# "Software"), to deal in the Software without restriction, including
|
@@ -20,7 +22,6 @@
|
|
20
22
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
23
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
24
|
#
|
23
|
-
# Contributors: Jens Kraemer
|
24
25
|
#++
|
25
26
|
|
26
27
|
require 'feed_tools'
|
@@ -28,51 +29,54 @@ require 'feed_tools/helpers/generic_helper'
|
|
28
29
|
|
29
30
|
# This module provides helper methods for simplifying normal interactions with
|
30
31
|
# the FeedTools library.
|
31
|
-
module
|
32
|
-
|
33
|
-
|
32
|
+
module FeedTools
|
33
|
+
module FeedToolsHelper
|
34
|
+
include FeedTools::GenericHelper
|
35
|
+
private :validate_options
|
34
36
|
|
35
|
-
|
37
|
+
@@default_local_path = File.expand_path('.')
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
# Returns the default path to load local files from
|
40
|
+
def self.default_local_path
|
41
|
+
@@default_local_path
|
42
|
+
end
|
41
43
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
# Sets the default path to load local files from
|
45
|
+
def self.default_local_path=(new_default_local_path)
|
46
|
+
@@default_local_path = new_default_local_path
|
47
|
+
end
|
46
48
|
|
47
|
-
protected
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
49
|
+
protected
|
50
|
+
# Loads a feed within a block for more consistent syntax and control
|
51
|
+
# over the FeedTools environment.
|
52
|
+
def with_feed(options={})
|
53
|
+
validate_options([ :from_file, :from_url, :from_data, :feed_cache ],
|
54
|
+
options.keys)
|
55
|
+
options = { :feed_cache =>
|
56
|
+
FeedTools.configurations[:feed_cache] }.merge(options)
|
57
|
+
if options[:from_file]
|
58
|
+
file_path = File.expand_path(@@default_local_path + '/' +
|
59
|
+
options[:from_file])
|
60
|
+
if !File.exists?(file_path)
|
61
|
+
file_path = File.expand_path(options[:from_file])
|
62
|
+
end
|
63
|
+
if !File.exists?(file_path)
|
64
|
+
raise "No such file - #{file_path}"
|
65
|
+
end
|
66
|
+
feed = FeedTools::Feed.open("file://#{file_path}")
|
67
|
+
elsif options[:from_url]
|
68
|
+
feed = FeedTools::Feed.open(options[:from_url])
|
69
|
+
elsif options[:from_data]
|
70
|
+
feed = FeedTools::Feed.new
|
71
|
+
feed.feed_data = options[:from_data]
|
72
|
+
else
|
73
|
+
raise "No data source specified"
|
62
74
|
end
|
63
|
-
|
64
|
-
|
65
|
-
feed
|
66
|
-
|
67
|
-
feed =
|
68
|
-
feed.feed_data = options[:from_data]
|
69
|
-
else
|
70
|
-
raise "No data source specified"
|
75
|
+
@@save_cache = FeedTools.configurations[:feed_cache].to_s
|
76
|
+
FeedTools.configurations[:feed_cache] = options[:feed_cache].to_s
|
77
|
+
yield feed
|
78
|
+
FeedTools.configurations[:feed_cache] = @@save_cache
|
79
|
+
feed = nil
|
71
80
|
end
|
72
|
-
@@save_cache = FeedTools.feed_cache
|
73
|
-
FeedTools.feed_cache = options[:feed_cache]
|
74
|
-
yield feed
|
75
|
-
FeedTools.feed_cache = @@save_cache
|
76
|
-
feed = nil
|
77
81
|
end
|
78
82
|
end
|
@@ -21,6 +21,9 @@
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
22
|
#++
|
23
23
|
|
24
|
+
require 'feed_tools'
|
25
|
+
require 'rexml/document'
|
26
|
+
|
24
27
|
module FeedTools
|
25
28
|
# Generic methods needed in numerous places throughout FeedTools
|
26
29
|
module GenericHelper
|
@@ -32,5 +35,166 @@ module FeedTools
|
|
32
35
|
raise "Unknown options: #{unknown_option_keys}"
|
33
36
|
end
|
34
37
|
end
|
38
|
+
|
39
|
+
# Selects the first non-blank result.
|
40
|
+
def select_not_blank(results, &block)
|
41
|
+
for result in results
|
42
|
+
blank_result = false
|
43
|
+
if !block.nil?
|
44
|
+
blank_result = block.call(result)
|
45
|
+
else
|
46
|
+
blank_result = result.to_s.blank?
|
47
|
+
end
|
48
|
+
unless result.nil? || blank_result
|
49
|
+
return result
|
50
|
+
end
|
51
|
+
end
|
52
|
+
return nil
|
53
|
+
end
|
54
|
+
|
55
|
+
# Runs through a list of XPath queries on an element or document and
|
56
|
+
# returns the first non-blank result. Subsequent XPath queries will
|
57
|
+
# not be evaluated.
|
58
|
+
def try_xpaths(element, xpath_list,
|
59
|
+
options={}, &block)
|
60
|
+
validate_options([ :select_result_value ],
|
61
|
+
options.keys)
|
62
|
+
options = { :select_result_value => false }.merge(options)
|
63
|
+
|
64
|
+
result = nil
|
65
|
+
if element.nil?
|
66
|
+
return nil
|
67
|
+
end
|
68
|
+
for xpath in xpath_list
|
69
|
+
result = REXML::XPath.liberal_first(element, xpath,
|
70
|
+
FEED_TOOLS_NAMESPACES)
|
71
|
+
if options[:select_result_value] && !result.nil?
|
72
|
+
if result.respond_to?(:value)
|
73
|
+
result = result.value
|
74
|
+
else
|
75
|
+
result = result.to_s
|
76
|
+
end
|
77
|
+
end
|
78
|
+
blank_result = false
|
79
|
+
if block_given?
|
80
|
+
blank_result = yield(result)
|
81
|
+
else
|
82
|
+
blank_result = result.to_s.blank?
|
83
|
+
end
|
84
|
+
if !blank_result
|
85
|
+
if result.respond_to? :strip
|
86
|
+
result.strip!
|
87
|
+
end
|
88
|
+
return result
|
89
|
+
end
|
90
|
+
end
|
91
|
+
for xpath in xpath_list
|
92
|
+
result = REXML::XPath.liberal_first(element, xpath)
|
93
|
+
if options[:select_result_value] && !result.nil?
|
94
|
+
if result.respond_to?(:value)
|
95
|
+
result = result.value
|
96
|
+
else
|
97
|
+
result = result.to_s
|
98
|
+
end
|
99
|
+
end
|
100
|
+
blank_result = false
|
101
|
+
if block_given?
|
102
|
+
blank_result = yield(result)
|
103
|
+
else
|
104
|
+
blank_result = result.to_s.blank?
|
105
|
+
end
|
106
|
+
if !blank_result
|
107
|
+
if result.respond_to? :strip
|
108
|
+
result.strip!
|
109
|
+
end
|
110
|
+
return result
|
111
|
+
end
|
112
|
+
end
|
113
|
+
for xpath in xpath_list
|
114
|
+
if xpath =~ /^\w+$/
|
115
|
+
for child in element.children
|
116
|
+
if child.class == REXML::Element
|
117
|
+
if child.name.downcase == xpath.downcase
|
118
|
+
result = child
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
if options[:select_result_value] && !result.nil?
|
123
|
+
if result.respond_to?(:value)
|
124
|
+
result = result.value
|
125
|
+
else
|
126
|
+
result = result.to_s
|
127
|
+
end
|
128
|
+
end
|
129
|
+
blank_result = false
|
130
|
+
if block_given?
|
131
|
+
blank_result = yield(result)
|
132
|
+
else
|
133
|
+
blank_result = result.to_s.blank?
|
134
|
+
end
|
135
|
+
if !blank_result
|
136
|
+
if result.respond_to? :strip
|
137
|
+
result.strip!
|
138
|
+
end
|
139
|
+
return result
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
return nil
|
144
|
+
end
|
145
|
+
|
146
|
+
# Runs through a list of XPath queries on an element or document and
|
147
|
+
# returns the first non-empty result. Subsequent XPath queries will
|
148
|
+
# not be evaluated.
|
149
|
+
def try_xpaths_all(element, xpath_list, options={})
|
150
|
+
validate_options([ :select_result_value ],
|
151
|
+
options.keys)
|
152
|
+
options = { :select_result_value => false }.merge(options)
|
153
|
+
|
154
|
+
results = []
|
155
|
+
if element.nil?
|
156
|
+
return []
|
157
|
+
end
|
158
|
+
for xpath in xpath_list
|
159
|
+
results = REXML::XPath.liberal_match(element, xpath,
|
160
|
+
FEED_TOOLS_NAMESPACES)
|
161
|
+
if options[:select_result_value] && !results.nil? && !results.empty?
|
162
|
+
results =
|
163
|
+
results.map { |x| x.respond_to?(:value) ? x.value : x.to_s }
|
164
|
+
end
|
165
|
+
if results.blank?
|
166
|
+
results = REXML::XPath.liberal_match(element, xpath)
|
167
|
+
else
|
168
|
+
return results
|
169
|
+
end
|
170
|
+
if options[:select_result_value] && !results.nil? && !results.empty?
|
171
|
+
results =
|
172
|
+
results.map { |x| x.respond_to?(:value) ? x.value : x.to_s }
|
173
|
+
end
|
174
|
+
if !results.blank?
|
175
|
+
return results
|
176
|
+
end
|
177
|
+
end
|
178
|
+
for xpath in xpath_list
|
179
|
+
if xpath =~ /^\w+$/
|
180
|
+
results = []
|
181
|
+
for child in element.children
|
182
|
+
if child.class == REXML::Element
|
183
|
+
if child.name.downcase == xpath.downcase
|
184
|
+
results << child
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
if options[:select_result_value] && !results.nil? && !results.empty?
|
189
|
+
results =
|
190
|
+
results.map { |x| x.inner_xml }
|
191
|
+
end
|
192
|
+
if !results.blank?
|
193
|
+
return results
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
return []
|
198
|
+
end
|
35
199
|
end
|
36
200
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2005 Robert Aman
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
require 'feed_tools'
|
25
|
+
require 'net/http'
|
26
|
+
|
27
|
+
# TODO: Not used yet, don't load since it'll only be a performance hit
|
28
|
+
# require 'net/https'
|
29
|
+
# require 'net/ftp'
|
30
|
+
|
31
|
+
# TODO: Refactor http_fetch and other methods.
|
32
|
+
module FeedTools
|
33
|
+
# Methods for pulling remote data
|
34
|
+
module RetrievalHelper
|
35
|
+
end
|
36
|
+
end
|
data/rakefile
CHANGED
@@ -7,7 +7,7 @@ require 'rake/gempackagetask'
|
|
7
7
|
require 'rake/contrib/rubyforgepublisher'
|
8
8
|
|
9
9
|
PKG_NAME = 'feedtools'
|
10
|
-
PKG_VERSION = '0.2.
|
10
|
+
PKG_VERSION = '0.2.19'
|
11
11
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
12
12
|
|
13
13
|
RELEASE_NAME = "REL #{PKG_VERSION}"
|
@@ -27,7 +27,62 @@ task :default => [ :test_all ]
|
|
27
27
|
|
28
28
|
Rake::TestTask.new("test_all") { |t|
|
29
29
|
t.libs << "test"
|
30
|
-
t.
|
30
|
+
t.test_files = FileList['test/unit/*_test.rb']
|
31
|
+
t.verbose = true
|
32
|
+
}
|
33
|
+
Rake::TestTask.new("amp_test") { |t|
|
34
|
+
t.libs << "test"
|
35
|
+
t.test_files = FileList['test/unit/amp_test.rb']
|
36
|
+
t.verbose = true
|
37
|
+
}
|
38
|
+
Rake::TestTask.new("atom_test") { |t|
|
39
|
+
t.libs << "test"
|
40
|
+
t.test_files = FileList['test/unit/atom_test.rb']
|
41
|
+
t.verbose = true
|
42
|
+
}
|
43
|
+
Rake::TestTask.new("cache_test") { |t|
|
44
|
+
t.libs << "test"
|
45
|
+
t.test_files = FileList['test/unit/cache_test.rb']
|
46
|
+
t.verbose = true
|
47
|
+
}
|
48
|
+
Rake::TestTask.new("cdf_test") { |t|
|
49
|
+
t.libs << "test"
|
50
|
+
t.test_files = FileList['test/unit/cdf_test.rb']
|
51
|
+
t.verbose = true
|
52
|
+
}
|
53
|
+
Rake::TestTask.new("encoding_test") { |t|
|
54
|
+
t.libs << "test"
|
55
|
+
t.test_files = FileList['test/unit/encoding_test.rb']
|
56
|
+
t.verbose = true
|
57
|
+
}
|
58
|
+
Rake::TestTask.new("generation_test") { |t|
|
59
|
+
t.libs << "test"
|
60
|
+
t.test_files = FileList['test/unit/generation_test.rb']
|
61
|
+
t.verbose = true
|
62
|
+
}
|
63
|
+
Rake::TestTask.new("helper_test") { |t|
|
64
|
+
t.libs << "test"
|
65
|
+
t.test_files = FileList['test/unit/helper_test.rb']
|
66
|
+
t.verbose = true
|
67
|
+
}
|
68
|
+
Rake::TestTask.new("interface_test") { |t|
|
69
|
+
t.libs << "test"
|
70
|
+
t.test_files = FileList['test/unit/interface_test.rb']
|
71
|
+
t.verbose = true
|
72
|
+
}
|
73
|
+
Rake::TestTask.new("nonstandard_test") { |t|
|
74
|
+
t.libs << "test"
|
75
|
+
t.test_files = FileList['test/unit/nonstandard_test.rb']
|
76
|
+
t.verbose = true
|
77
|
+
}
|
78
|
+
Rake::TestTask.new("rdf_test") { |t|
|
79
|
+
t.libs << "test"
|
80
|
+
t.test_files = FileList['test/unit/rdf_test.rb']
|
81
|
+
t.verbose = true
|
82
|
+
}
|
83
|
+
Rake::TestTask.new("rss_test") { |t|
|
84
|
+
t.libs << "test"
|
85
|
+
t.test_files = FileList['test/unit/rss_test.rb']
|
31
86
|
t.verbose = true
|
32
87
|
}
|
33
88
|
|
@@ -62,6 +117,7 @@ spec = Gem::Specification.new do |s|
|
|
62
117
|
|
63
118
|
s.add_dependency('activerecord', '>= 1.10.1')
|
64
119
|
s.add_dependency('uuidtools', '>= 0.1.2')
|
120
|
+
s.add_dependency('builder', '>= 1.2.4')
|
65
121
|
|
66
122
|
s.require_path = 'lib'
|
67
123
|
s.autorequire = 'feed_tools'
|
@@ -82,6 +138,246 @@ Rake::GemPackageTask.new(spec) do |p|
|
|
82
138
|
p.need_zip = true
|
83
139
|
end
|
84
140
|
|
141
|
+
task :benchmark do
|
142
|
+
$:.unshift(File.dirname(__FILE__) + '/lib')
|
143
|
+
require 'benchmark'
|
144
|
+
require 'feed_tools'
|
145
|
+
puts "Benchmarking FeedTools #{FEED_TOOLS_VERSION}..."
|
146
|
+
results = Benchmark.measure do
|
147
|
+
10.times do
|
148
|
+
feed = FeedTools::Feed.new
|
149
|
+
once = Benchmark.measure do
|
150
|
+
feed.feed_data = <<-FEED
|
151
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
152
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
|
153
|
+
<channel rdf:about="http://slashdot.org/">
|
154
|
+
<title>Slashdot</title>
|
155
|
+
<link>http://slashdot.org/</link>
|
156
|
+
<description>News for nerds, stuff that matters</description>
|
157
|
+
<dc:language>en-us</dc:language>
|
158
|
+
<dc:rights>Copyright 1997-2005, OSTG - Open Source Technology Group, Inc. All Rights Reserved.</dc:rights>
|
159
|
+
|
160
|
+
<dc:date>2006-01-19T04:30:55+00:00</dc:date>
|
161
|
+
<dc:publisher>OSTG</dc:publisher>
|
162
|
+
<dc:creator>pater@slashdot.org</dc:creator>
|
163
|
+
<dc:subject>Technology</dc:subject>
|
164
|
+
<syn:updatePeriod>hourly</syn:updatePeriod>
|
165
|
+
<syn:updateFrequency>1</syn:updateFrequency>
|
166
|
+
|
167
|
+
<syn:updateBase>1970-01-01T00:00+00:00</syn:updateBase>
|
168
|
+
<items>
|
169
|
+
<rdf:Seq>
|
170
|
+
<rdf:li rdf:resource="http://hardware.slashdot.org/article.pl?sid=06/01/19/0035238&from=rss" />
|
171
|
+
<rdf:li rdf:resource="http://developers.slashdot.org/article.pl?sid=06/01/19/0026203&from=rss" />
|
172
|
+
<rdf:li rdf:resource="http://science.slashdot.org/article.pl?sid=06/01/19/0019225&from=rss" />
|
173
|
+
<rdf:li rdf:resource="http://ask.slashdot.org/article.pl?sid=06/01/18/2133251&from=rss" />
|
174
|
+
<rdf:li rdf:resource="http://yro.slashdot.org/article.pl?sid=06/01/18/2037259&from=rss" />
|
175
|
+
|
176
|
+
<rdf:li rdf:resource="http://linux.slashdot.org/article.pl?sid=06/01/18/1945206&from=rss" />
|
177
|
+
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=06/01/18/1931219&from=rss" />
|
178
|
+
<rdf:li rdf:resource="http://science.slashdot.org/article.pl?sid=06/01/18/1832232&from=rss" />
|
179
|
+
<rdf:li rdf:resource="http://politics.slashdot.org/article.pl?sid=06/01/18/1722256&from=rss" />
|
180
|
+
<rdf:li rdf:resource="http://slashdot.org/article.pl?sid=06/01/18/1654232&from=rss" />
|
181
|
+
</rdf:Seq>
|
182
|
+
</items>
|
183
|
+
<image rdf:resource="http://images.slashdot.org/topics/topicslashdot.gif" />
|
184
|
+
<textinput rdf:resource="http://slashdot.org/search.pl" />
|
185
|
+
|
186
|
+
</channel>
|
187
|
+
<image rdf:about="http://images.slashdot.org/topics/topicslashdot.gif">
|
188
|
+
<title>Slashdot</title>
|
189
|
+
<url>http://images.slashdot.org/topics/topicslashdot.gif</url>
|
190
|
+
<link>http://slashdot.org/</link>
|
191
|
+
</image>
|
192
|
+
<item rdf:about="http://hardware.slashdot.org/article.pl?sid=06/01/19/0035238&from=rss">
|
193
|
+
|
194
|
+
<title>South Korea To Develop Army and Police Robots</title>
|
195
|
+
<link>http://rss.slashdot.org/Slashdot/slashdot?m=3171</link>
|
196
|
+
<description>JonathanGCohen writes "South Korea is planning on developing an advanced line of robots for military and police use by the 2010 decade. A $34 million USD infusion of cash will spur development and result in robotic applications like security watchmen and eight-legged autonomous combat vehicles. "<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3171"/></description>
|
197
|
+
<dc:creator>samzenpus</dc:creator>
|
198
|
+
<dc:date>2006-01-19T04:14:00+00:00</dc:date>
|
199
|
+
<dc:subject>robotics</dc:subject>
|
200
|
+
|
201
|
+
<slash:department>you-have-twenty-seconds-to-comply</slash:department>
|
202
|
+
<slash:section>hardware</slash:section>
|
203
|
+
<slash:comments>29</slash:comments>
|
204
|
+
<slash:hit_parade>29,29,27,12,1,0,0</slash:hit_parade>
|
205
|
+
<feedburner:origLink>http://hardware.slashdot.org/article.pl?sid=06/01/19/0035238&from=rss</feedburner:origLink>
|
206
|
+
</item>
|
207
|
+
|
208
|
+
<item rdf:about="http://developers.slashdot.org/article.pl?sid=06/01/19/0026203&from=rss">
|
209
|
+
<title>Computer Science Students Outsource Homework</title>
|
210
|
+
<link>http://rss.slashdot.org/Slashdot/slashdot?m=3170</link>
|
211
|
+
<description>Carl Bialik from the WSJ writes "'If U.S. companies can go online to outsource their programming, why can't U.S. computer students outsource their homework--which, after all, often involves writing sample programs?' Wall Street Journal colummnist Lee Gomes asks. 'Scruples aside, no reason at all. Search for "homework" in the data base of Rent A Coder projects, and you get 1,000 hits. (An impressive number, but still a tiny fraction of all computer students, the vast majority of whom are no doubt an honest and hardworking lot.)' Some of the Rent a Coder users appear to be outsourcing their way through school, at low costs--probably less than $100 per assignment. The posting are, of course, anonymous, but Gomes traces one to a student at the New Jersey Institute of Technology, where an instructor tells him that Rent a Coder contributed to a problem of plagiarism last semester."<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3170"/></description>
|
212
|
+
<dc:creator>samzenpus</dc:creator>
|
213
|
+
<dc:date>2006-01-19T03:08:00+00:00</dc:date>
|
214
|
+
|
215
|
+
<dc:subject>ed</dc:subject>
|
216
|
+
<slash:department>what-happened-to-putting-it-into-your-graphing-calculator</slash:department>
|
217
|
+
<slash:section>developers</slash:section>
|
218
|
+
<slash:comments>142</slash:comments>
|
219
|
+
<slash:hit_parade>142,139,121,75,18,8,4</slash:hit_parade>
|
220
|
+
<feedburner:origLink>http://developers.slashdot.org/article.pl?sid=06/01/19/0026203&from=rss</feedburner:origLink>
|
221
|
+
|
222
|
+
</item>
|
223
|
+
<item rdf:about="http://science.slashdot.org/article.pl?sid=06/01/19/0019225&from=rss">
|
224
|
+
<title>MythBusters - The Lost Experiments</title>
|
225
|
+
<link>http://rss.slashdot.org/Slashdot/slashdot?m=3169</link>
|
226
|
+
<description>theLorax writes "From Discovery: "If you like the MythBusters here are some videos they just posted of some of the out takes and things that didn't appear on the show. Cola bits (cleaning things with cola), water torture, otter ping pong, live power lines, cement build up and plywood flight." Here is the interview we did with these guys in December.
|
227
|
+
<p><a href="http://rss.slashdot.org/~c/Slashdot/slashdot?a=SXBhr7"><img src="http://rss.slashdot.org/~c/Slashdot/slashdot?i=SXBhr7" border="0"></img></a></p><img src="http://rss.slashdot.org/Slashdot/slashdot?g=3169"/></description>
|
228
|
+
|
229
|
+
<dc:creator>samzenpus</dc:creator>
|
230
|
+
<dc:date>2006-01-19T01:58:00+00:00</dc:date>
|
231
|
+
<dc:subject>tv</dc:subject>
|
232
|
+
<slash:department>they-should-battle-mr.wizard</slash:department>
|
233
|
+
<slash:section>science</slash:section>
|
234
|
+
<slash:comments>134</slash:comments>
|
235
|
+
|
236
|
+
<slash:hit_parade>134,130,95,61,23,12,6</slash:hit_parade>
|
237
|
+
<feedburner:origLink>http://science.slashdot.org/article.pl?sid=06/01/19/0019225&from=rss</feedburner:origLink>
|
238
|
+
</item>
|
239
|
+
<item rdf:about="http://ask.slashdot.org/article.pl?sid=06/01/18/2133251&from=rss">
|
240
|
+
<title>Has Corporate Info Security Gotten Out of Hand?</title>
|
241
|
+
<link>http://rss.slashdot.org/Slashdot/slashdot?m=3168</link>
|
242
|
+
|
243
|
+
<description>KoshClassic asks: "What is the right balance between security and productivity, in the corporate IT environment? Looking back at my company, 10 years ago, our machines were connected directly to the Internet, no proxy, no firewall, no antivirus software. Today, my company's proxy server blocks access to: 'bad' web sites (such as Google Groups; our 'antivirus' software prevents our machines (even machines that host production applications) from carrying out legitimate functions, such as the sending of email via SMTP; and individual employees are forced to apply security patches with little or no notice, under threat of their machines loosing network access, if they do not comply by the deadline. On one hand, you can never be too secure, however on the other hand, have we become so secure that we're stifling our own ability to get things done? What is the situation like at other companies?"<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3168"/></description>
|
244
|
+
<dc:creator>Cliff</dc:creator>
|
245
|
+
<dc:date>2006-01-19T00:52:00+00:00</dc:date>
|
246
|
+
<dc:subject>security</dc:subject>
|
247
|
+
<slash:department>proper-security-is-like-walking-on-monowire</slash:department>
|
248
|
+
<slash:section>askslashdot</slash:section>
|
249
|
+
|
250
|
+
<slash:comments>259</slash:comments>
|
251
|
+
<slash:hit_parade>259,253,200,130,29,16,11</slash:hit_parade>
|
252
|
+
<feedburner:origLink>http://ask.slashdot.org/article.pl?sid=06/01/18/2133251&from=rss</feedburner:origLink>
|
253
|
+
</item>
|
254
|
+
<item rdf:about="http://yro.slashdot.org/article.pl?sid=06/01/18/2037259&from=rss">
|
255
|
+
<title>Slashback: GPLv3, Firefly, iTunes</title>
|
256
|
+
|
257
|
+
<link>http://rss.slashdot.org/Slashdot/slashdot?m=3167</link>
|
258
|
+
<description>Slashback tonight brings some corrections, clarifications, and updates to previous Slashdot stories, including Stallman's comments on GPLv3, Firefly fans clinging to hope, sentence handed down in student felony webpage refresh case, GP2X GPL issues resolved, Korean cloning scientist may get to keep his patents, Apple changes their tune for iTunes ministore, and much more -- Read on for details.<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3167"/></description>
|
259
|
+
<dc:creator>ScuttleMonkey</dc:creator>
|
260
|
+
<dc:date>2006-01-18T23:59:00+00:00</dc:date>
|
261
|
+
<dc:subject>slashback</dc:subject>
|
262
|
+
<slash:department>different-results-from-the-same-actions</slash:department>
|
263
|
+
|
264
|
+
<slash:section>yro</slash:section>
|
265
|
+
<slash:comments>164</slash:comments>
|
266
|
+
<slash:hit_parade>164,158,133,89,30,16,7</slash:hit_parade>
|
267
|
+
<feedburner:origLink>http://yro.slashdot.org/article.pl?sid=06/01/18/2037259&from=rss</feedburner:origLink>
|
268
|
+
</item>
|
269
|
+
<item rdf:about="http://linux.slashdot.org/article.pl?sid=06/01/18/1945206&from=rss">
|
270
|
+
|
271
|
+
<title>The Debian System Explained</title>
|
272
|
+
<link>http://rss.slashdot.org/Slashdot/slashdot?m=3166</link>
|
273
|
+
<description>An anonymous reader writes "XYZComputing has a great interview with Martin F. Krafft, the author of "The Debian System". From the article: 'Despite Debian GNU/Linux's important role in today's computing environment, it is largely misunderstood and oftentimes even discounted as being an operating system which is exclusively for professionals and elite users. In this book Krafft, explains his concept of Debian, which includes not only the operating system but also its underpinnings. Debian is not only a robust and scalable Linux distribution, but it has many other features which are worth looking into, like its open development cycle and rigorous quality control.'"
|
274
|
+
<p><a href="http://rss.slashdot.org/~c/Slashdot/slashdot?a=GkVD75"><img src="http://rss.slashdot.org/~c/Slashdot/slashdot?i=GkVD75" border="0"></img></a></p><img src="http://rss.slashdot.org/Slashdot/slashdot?g=3166"/></description>
|
275
|
+
<dc:creator>ScuttleMonkey</dc:creator>
|
276
|
+
|
277
|
+
<dc:date>2006-01-18T22:47:00+00:00</dc:date>
|
278
|
+
<dc:subject>debian</dc:subject>
|
279
|
+
<slash:department>solid-oak-log-for-the-distro-debate-fire</slash:department>
|
280
|
+
<slash:section>linux</slash:section>
|
281
|
+
<slash:comments>170</slash:comments>
|
282
|
+
<slash:hit_parade>170,168,126,75,23,15,7</slash:hit_parade>
|
283
|
+
|
284
|
+
<feedburner:origLink>http://linux.slashdot.org/article.pl?sid=06/01/18/1945206&from=rss</feedburner:origLink>
|
285
|
+
</item>
|
286
|
+
<item rdf:about="http://slashdot.org/article.pl?sid=06/01/18/1931219&from=rss">
|
287
|
+
<title>Futuremark 3DMark06 Released</title>
|
288
|
+
<link>http://rss.slashdot.org/Slashdot/slashdot?m=3165</link>
|
289
|
+
<description>jmke writes "Futuremark has released their latest graphics card evaluation software. The 2006 version features all the latest technologies and will stress even the most expensive video cards. From the announcement: 'Continuing forward in the development of advanced game performance benchmarks, Futuremark announced today the release and immediate availability of 3DMark06. A more comprehensive and unrestricted benchmark than previous versions, 3DMark06 includes an array of 3D graphics, CPU and 3D feature tests for overall performance measurement of current and future PC gaming systems.' Futuremark is offering a free download of the software with limited capability while offering an advanced edition for a price. PC Perspectives also has a nice overview of some of the features available."<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3165"/></description>
|
290
|
+
|
291
|
+
<dc:creator>ScuttleMonkey</dc:creator>
|
292
|
+
<dc:date>2006-01-18T22:04:00+00:00</dc:date>
|
293
|
+
<dc:subject>graphics</dc:subject>
|
294
|
+
<slash:department>one-chip-to-rule-them-all</slash:department>
|
295
|
+
<slash:section>mainpage</slash:section>
|
296
|
+
<slash:comments>96</slash:comments>
|
297
|
+
|
298
|
+
<slash:hit_parade>96,92,75,48,16,8,6</slash:hit_parade>
|
299
|
+
<feedburner:origLink>http://slashdot.org/article.pl?sid=06/01/18/1931219&from=rss</feedburner:origLink>
|
300
|
+
</item>
|
301
|
+
<item rdf:about="http://science.slashdot.org/article.pl?sid=06/01/18/1832232&from=rss">
|
302
|
+
<title>New Device to Detect Skin Cancer From A Picture?</title>
|
303
|
+
<link>http://rss.slashdot.org/Slashdot/slashdot?m=3164</link>
|
304
|
+
|
305
|
+
<description>JonathanGCohen writes "News.com is reporting on a new machine that can tell you all about your skin's unique features (excessive oil, UV damage, etc.) using an image scan and software to analyze it. Its inventors plan on developing a version that can even detect skin cancer." From the article: "Apart from numbers, the technology, called Clarity Pro, can depict the depth and severity of wrinkles in a 3D chart, show the extent of bacteria-filled pores in a graph, or represent UV damage in purple dots scattered about your face in a white-light image. It can also calculate how long a person can be exposed to the sun, in minutes or hours a day, before incurring more UV damage."<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3164"/></description>
|
306
|
+
<dc:creator>ScuttleMonkey</dc:creator>
|
307
|
+
<dc:date>2006-01-18T21:19:00+00:00</dc:date>
|
308
|
+
<dc:subject>biotech</dc:subject>
|
309
|
+
<slash:department>snapshot-physicals</slash:department>
|
310
|
+
<slash:section>science</slash:section>
|
311
|
+
|
312
|
+
<slash:comments>68</slash:comments>
|
313
|
+
<slash:hit_parade>68,64,55,41,13,8,6</slash:hit_parade>
|
314
|
+
<feedburner:origLink>http://science.slashdot.org/article.pl?sid=06/01/18/1832232&from=rss</feedburner:origLink>
|
315
|
+
</item>
|
316
|
+
<item rdf:about="http://politics.slashdot.org/article.pl?sid=06/01/18/1722256&from=rss">
|
317
|
+
<title>Piracy Setup Discovered in WV Capitol Building</title>
|
318
|
+
|
319
|
+
<link>http://rss.slashdot.org/Slashdot/slashdot?m=3163</link>
|
320
|
+
<description>arakis writes "Someone in West Virginia has apparently spent tens of thousands in state funds to acquire computers and video gear to copy movies and music. From the article: 'Ferguson confirmed Tuesday that his staff found the makeshift audio-video studio amid his widening probe into spending and other abuses at the state General Services Division.' Looks like some employees are getting the axe for everything from purchasing abuse to time fraud."
|
321
|
+
<p><a href="http://rss.slashdot.org/~c/Slashdot/slashdot?a=lS9OeC"><img src="http://rss.slashdot.org/~c/Slashdot/slashdot?i=lS9OeC" border="0"></img></a></p><img src="http://rss.slashdot.org/Slashdot/slashdot?g=3163"/></description>
|
322
|
+
<dc:creator>ScuttleMonkey</dc:creator>
|
323
|
+
<dc:date>2006-01-18T20:36:00+00:00</dc:date>
|
324
|
+
|
325
|
+
<dc:subject>media</dc:subject>
|
326
|
+
<slash:department>making-a-little-on-the-side</slash:department>
|
327
|
+
<slash:section>politics</slash:section>
|
328
|
+
<slash:comments>311</slash:comments>
|
329
|
+
<slash:hit_parade>311,304,232,144,47,26,20</slash:hit_parade>
|
330
|
+
<feedburner:origLink>http://politics.slashdot.org/article.pl?sid=06/01/18/1722256&from=rss</feedburner:origLink>
|
331
|
+
|
332
|
+
</item>
|
333
|
+
<item rdf:about="http://slashdot.org/article.pl?sid=06/01/18/1654232&from=rss">
|
334
|
+
<title>Admission Tickets as Text Messages</title>
|
335
|
+
<link>http://rss.slashdot.org/Slashdot/slashdot?m=3162</link>
|
336
|
+
<description>lee1 writes to tell us that InfoWorld is reporting that Smartmachine and their partner Skidata have developed a new way to allow customers to purchase and receive tickets to events. The new ticketing system allows users to "have a ticket sent to their mobile phone via SMS (Short Message Service) in the form of a 2D (two-dimensional) bar code. At the gate, they slide their mobile phone display showing the bar code by a bar code reader." The new technology also claims to help combat the counterfeit, pilferage, and repeat use that can be such a problem for paper tickets.<img src="http://rss.slashdot.org/Slashdot/slashdot?g=3162"/></description>
|
337
|
+
<dc:creator>ScuttleMonkey</dc:creator>
|
338
|
+
|
339
|
+
<dc:date>2006-01-18T19:53:00+00:00</dc:date>
|
340
|
+
<dc:subject>tech</dc:subject>
|
341
|
+
<slash:department>hope-you-have-a-cell-phone</slash:department>
|
342
|
+
<slash:section>mainpage</slash:section>
|
343
|
+
<slash:comments>215</slash:comments>
|
344
|
+
<slash:hit_parade>215,211,177,100,36,14,8</slash:hit_parade>
|
345
|
+
|
346
|
+
<feedburner:origLink>http://slashdot.org/article.pl?sid=06/01/18/1654232&from=rss</feedburner:origLink>
|
347
|
+
</item>
|
348
|
+
<textinput rdf:about="http://slashdot.org/search.pl">
|
349
|
+
<title>Search Slashdot</title>
|
350
|
+
<description>Search Slashdot stories</description>
|
351
|
+
<name>query</name>
|
352
|
+
|
353
|
+
<link>http://slashdot.org/search.pl</link>
|
354
|
+
</textinput>
|
355
|
+
</rdf:RDF>
|
356
|
+
FEED
|
357
|
+
feed.title
|
358
|
+
feed.subtitle
|
359
|
+
feed.link
|
360
|
+
feed.url
|
361
|
+
feed.time
|
362
|
+
feed.entries.each do |entry|
|
363
|
+
entry.title
|
364
|
+
entry.link
|
365
|
+
entry.content
|
366
|
+
entry.tags
|
367
|
+
entry.author
|
368
|
+
entry.time
|
369
|
+
end
|
370
|
+
end
|
371
|
+
puts "Parse: " + once.to_s
|
372
|
+
once = Benchmark.measure do
|
373
|
+
output_xml = feed.build_xml("atom", 1.0)
|
374
|
+
end
|
375
|
+
puts "Generate: " + once.to_s
|
376
|
+
end
|
377
|
+
end
|
378
|
+
puts "Total: " + results.to_s
|
379
|
+
end
|
380
|
+
|
85
381
|
task :lines do
|
86
382
|
lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
|
87
383
|
|