Skip to content

Commit

Permalink
almost assigning proper publishers. Almost.
Browse files Browse the repository at this point in the history
  • Loading branch information
alxjrvs committed Mar 12, 2012
1 parent 6dbccad commit 826f2a6
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions parser.rb
@@ -1,16 +1,41 @@
require 'open-uri'

class Book
attr_accessor :date, :name, :price, :pub

def initialize(date, name, price, pub)
@date = date
@name = name
@price = price
@pub = pub
end
end

$pub_list = ['DARK HORSE COMICS',
'DC COMICS',
'IDW PUBLISHING',
'IMAGE COMICS',
'MARVEL COMICS',
'COMICS'
]


def siteopen(url)
file = open(url).read
current_pub = ''
for line in file
sing = line.strip.split("\t")
puts sing[1]
puts "TRY"
end
$current_pub = ''
for line in file
$sing = line.strip.split("\t")
if $sing.size < 3
$current_pub = $sing
else
s = Book.new($sing[0], $sing[1], $sing[2], $current_pub)
puts s.name
puts s.pub
end
end
file = nil
end


$DH = siteopen('http://www.previewsworld.com/shipping/newreleases.txt')

0 comments on commit 826f2a6

Please sign in to comment.