Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

version 0.0.5: fixes some issues after OEIS page elements were rearra…

…nged
  • Loading branch information...
commit 4b36bafd4ad79f4af81238a8ae8bc18e1cf8874a 1 parent 4ee7c30
@jdan authored
Showing with 4 additions and 4 deletions.
  1. +3 −3 lib/oeis.rb
  2. +1 −1  lib/oeis/version.rb
View
6 lib/oeis.rb
@@ -14,15 +14,15 @@ def initialize(ls)
doc = Nokogiri::HTML(open(url))
first_result = doc.css('table table:eq(2)').first
- info = first_result.css('tr:eq(3) table > tr > td > a').first
+ info = first_result.css('tr:eq(3) table > tr').first
if info.nil?
puts 'No sequence found.'
return nil
end
- @id = info.attributes['href'].value[1..-1]
- @title = info.attributes['title'].value
+ @id = info.css('td:eq(1) > a').text.strip
+ @title = info.css('td:eq(3)').text.strip
digits = first_result.css('tr:eq(4) table tr tt').text.split(', ')
@sequence = digits.map &:to_i
View
2  lib/oeis/version.rb
@@ -1,3 +1,3 @@
module OEIS
- VERSION = "0.0.4"
+ VERSION = "0.0.5"
end
Please sign in to comment.
Something went wrong with that request. Please try again.