arxiv-h 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/arxiv.rb +2 -2
- metadata +1 -1
data/lib/arxiv.rb
CHANGED
@@ -6,7 +6,7 @@ require 'nokogiri'
|
|
6
6
|
require 'uri'
|
7
7
|
|
8
8
|
|
9
|
-
|
9
|
+
ArxivResult = Struct.new :title, :abstract, :url, :date, :authors
|
10
10
|
|
11
11
|
|
12
12
|
class Arxiv
|
@@ -36,7 +36,7 @@ class Arxiv
|
|
36
36
|
doc = Nokogiri::HTML(response.body)
|
37
37
|
doc.xpath('//feed/entry').map do |item|
|
38
38
|
authors = item.xpath('author').map { |author| author.xpath('name').text }
|
39
|
-
|
39
|
+
ArxivResult.new(
|
40
40
|
item.xpath('title').text,
|
41
41
|
item.xpath('summary').text.gsub("\n", ' ').strip,
|
42
42
|
item.xpath('id').text,
|