Browse files

Rename :special type to :job, add a function boilerplate for extracti…

…ng data.
  • Loading branch information...
1 parent f5408af commit 225ff0e55a7c42d5a8695f970e66dddc4e51aa74 @jcla1 committed Oct 12, 2012
Showing with 6 additions and 1 deletion.
  1. +2 −0 lib/hn2json/entity.rb
  2. +4 −1 lib/hn2json/parser.rb
View
2 lib/hn2json/entity.rb
@@ -78,6 +78,8 @@ def get_attrs
@parser.get_attrs_poll self
when :discussion
@parser.get_attrs_discussion self
+ when :job
+ @parser.get_attrs_job self
when :error
raise ParseError, "Parser could not determine type on #{@id}"
end
View
5 lib/hn2json/parser.rb
@@ -34,7 +34,7 @@ def determine_type
return :error unless subtext
- return :special if subtext.content.split.length <= 3
+ return :job if subtext.content.split.length <= 3
tr = subtext.xpath('..').xpath('..').css('tr')
@@ -46,6 +46,9 @@ def determine_type
end
+ def get_attrs_job entity
+ end
+
def get_attrs_comment entity
parent_url = @doc.css('.comhead a')[2]['href']

0 comments on commit 225ff0e

Please sign in to comment.