Skip to content

Commit

Permalink
version 0.0.5: fixes some issues after OEIS page elements were rearra…
Browse files Browse the repository at this point in the history
…nged
  • Loading branch information
jdan committed Feb 22, 2013
1 parent 4ee7c30 commit 4b36baf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/oeis.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/oeis/version.rb
@@ -1,3 +1,3 @@
module OEIS
VERSION = "0.0.4"
VERSION = "0.0.5"
end

0 comments on commit 4b36baf

Please sign in to comment.