Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
almost assigning proper publishers. Almost.
- Loading branch information
Showing
1 changed file
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') | ||
|