libcraigscrape 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,6 +1,10 @@
1
1
  == Change Log
2
2
 
3
- === Release 0.8.3 (When?)
3
+ === Release 0.8.4 (TODO)
4
+ - Someone found a way to screw up hpricot's to_s method (posting1938291834-090610.html) and fixed by added html_source to the craigslist Scraper object, which returns the body of the post without passing it through hpricot. Its a better way to go anyways, and re-wrote a couple incidentals to use the html_source method...
5
+ - Adjusted the test cases a bit, since the user bodies being returned have slightly less cleanup in their output than they had prior
6
+
7
+ === Release 0.8.3 (August 2, 2010)
4
8
  - Someone was posting really bad html that was screwing up Hpricot. Such is to be expected when you're soliciting html from the general public I suppose. Added test_bugs_found061710 posting test, and fixed by stripping out the user body before parsing with Hpricot.
5
9
  - Added a MaxRedirectError and corresponding maximum_redirects_per_request cattr for the Craigscrape objects. This fixed a weird bug where craigslist was sending us in redirect circles around 06/10
6
10
 
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ include FileUtils
11
11
  RbConfig = Config unless defined? RbConfig
12
12
 
13
13
  NAME = "libcraigscrape"
14
- VERS = ENV['VERSION'] || "0.8.3"
14
+ VERS = ENV['VERSION'] || "0.8.4"
15
15
  PKG = "#{NAME}-#{VERS}"
16
16
 
17
17
  RDOC_OPTS = ['--quiet', '--title', 'The libcraigscrape Reference', '--main', 'README', '--inline-source']
data/lib/posting.rb CHANGED
@@ -18,7 +18,7 @@ class CraigScrape::Posting < CraigScrape::Scraper
18
18
  POSTING_ID = /PostingID\:[ ]+([\d]+)/
19
19
  REPLY_TO = /(.+)/
20
20
  PRICE = /((?:^\$[\d]+(?:\.[\d]{2})?)|(?:\$[\d]+(?:\.[\d]{2})?$))/
21
- USERBODY_PARTS = /\<div id\=\"userbody\">(.+)\<br[ ]*[\/]?\>\<br[ ]*[\/]?\>(.+)\<\/div\>/m
21
+ USERBODY_PARTS = /^(.+)\<div id\=\"userbody\">(.+)\<br[ ]*[\/]?\>\<br[ ]*[\/]?\>(.+)\<\/div\>(.+)$/m
22
22
  HTML_HEADER = /^(.+)\<div id\=\"userbody\">/m
23
23
  IMAGE_SRC = /\<im[a]?g[e]?[^\>]*src=(?:\'([^\']+)\'|\"([^\"]+)\"|([^ ]+))[^\>]*\>/
24
24
 
@@ -94,8 +94,8 @@ class CraigScrape::Posting < CraigScrape::Scraper
94
94
 
95
95
  # Integer, Craigslist's unique posting id
96
96
  def posting_id
97
- unless @posting_id
98
- cursor = (html/"#userbody").first if html
97
+ unless @posting_id
98
+ cursor = Hpricot.parse html_footer if html_footer
99
99
  cursor = cursor.next_node until cursor.nil? or POSTING_ID.match cursor.to_s
100
100
  @posting_id = $1.to_i if $1
101
101
  end
@@ -106,7 +106,7 @@ class CraigScrape::Posting < CraigScrape::Scraper
106
106
  # String, The full-html contents of the post
107
107
  def contents
108
108
  unless @contents
109
- @contents = user_body if html
109
+ @contents = user_body if html_source
110
110
  @contents = he_decode @contents.strip if @contents
111
111
  end
112
112
 
@@ -281,24 +281,30 @@ class CraigScrape::Posting < CraigScrape::Scraper
281
281
  # I set apart from html to work around the SystemStackError bugs in test_bugs_found061710. Essentially we
282
282
  # return everything above the user_body
283
283
  def html_head
284
- @html_head = Hpricot.parse $1 if @html_head.nil? and HTML_HEADER.match html.to_s
284
+ @html_head = Hpricot.parse $1 if @html_head.nil? and HTML_HEADER.match html_source
285
285
  # We return html itself if HTML_HEADER doesn't match, which would be case for a 404 page or something
286
286
  @html_head ||= html
287
287
 
288
288
  @html_head
289
289
  end
290
290
 
291
+ # Since we started having so many problems with Hpricot flipping out on whack content bodies,
292
+ # I added this to return everything south of the user_body
293
+ def html_footer
294
+ $4 if USERBODY_PARTS.match html_source
295
+ end
296
+
291
297
  # OK - so the biggest problem parsing the contents of a craigslist post is that users post invalid html all over the place
292
298
  # This bad html trips up hpricot, and I've resorted to splitting the page up using string parsing like so:
293
299
  # We return this as a string, since it makes sense, and since its tough to say how hpricot might mangle this if the html is whack
294
300
  def user_body
295
- $1 if USERBODY_PARTS.match html.to_s
301
+ $2 if USERBODY_PARTS.match html_source
296
302
  end
297
303
 
298
304
  # Read the notes on user_body. However, unlike the user_body, the craigslist portion of this div can be relied upon to be valid html.
299
305
  # So - we'll return it as an Hpricot object.
300
306
  def craigslist_body
301
- Hpricot.parse $2 if USERBODY_PARTS.match html.to_s
307
+ Hpricot.parse $3 if USERBODY_PARTS.match html_source
302
308
  end
303
309
 
304
310
  end
data/lib/scraper.rb CHANGED
@@ -90,7 +90,7 @@ class CraigScrape::Scraper
90
90
  # Indicates whether the resource has yet been retrieved from its associated url.
91
91
  # This is useful to distinguish whether the instance was instantiated for the purpose of an eager-load,
92
92
  # but hasn't yet been fetched.
93
- def downloaded?; !@html.nil?; end
93
+ def downloaded?; !@html_source.nil?; end
94
94
 
95
95
  # A URI object corresponding to this Scraped URL
96
96
  def uri
@@ -196,8 +196,15 @@ class CraigScrape::Scraper
196
196
  end
197
197
  end
198
198
 
199
+ # Returns a string, of the current URI's source code
200
+ def html_source
201
+ @html_source ||= fetch_uri uri if uri
202
+ @html_source
203
+ end
204
+
205
+ # Returns an hpricot parse, of the current URI
199
206
  def html
200
- @html ||= Hpricot.parse fetch_uri(uri) if uri
207
+ @html ||= Hpricot.parse html_source if html_source
201
208
  @html
202
209
  end
203
- end
210
+ end
@@ -0,0 +1,188 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <title>2008 GMC Sierra 2500HD</title>
5
+ <meta name="robots" content="NOARCHIVE,NOFOLLOW">
6
+ <link type="text/css" rel="stylesheet" media="all" href="http://www.craigslist.org/styles/craigslist.css?v=7">
7
+ </head>
8
+
9
+ <body class="posting">
10
+
11
+
12
+ <div class="bchead">
13
+ <a id="ef" href="/email.friend?postingID=1938291834">email this posting to a friend</a>
14
+ <a href="http://boston.craigslist.org/">boston craigslist</a> &gt;
15
+ <a href="http://boston.craigslist.org/gbs/">boston/camb/brook</a> &gt;
16
+ <a href="http://boston.craigslist.org/gbs/sss/">for sale / wanted</a> &gt;
17
+ <a href="http://boston.craigslist.org/gbs/art/">arts &amp; crafts</a>
18
+ </div>
19
+
20
+
21
+
22
+ <div id="flags">
23
+ <div id="flagMsg">
24
+ please <a href="http://www.craigslist.org/about/help/flags_and_community_moderation">flag</a> with care:
25
+ </div>
26
+ <div id="flagChooser">
27
+ <br>
28
+ <a class="fl" id="flag16" href="/flag/?flagCode=16&amp;postingID=1938291834"
29
+ title="Wrong category, wrong site, discusses another post, or otherwise misplaced">
30
+ miscategorized</a>
31
+ <br>
32
+
33
+ <a class="fl" id="flag28" href="/flag/?flagCode=28&amp;postingID=1938291834"
34
+ title="Violates craigslist Terms Of Use or other posted guidelines">
35
+ prohibited</a>
36
+ <br>
37
+
38
+ <a class="fl" id="flag15" href="/flag/?flagCode=15&amp;postingID=1938291834"
39
+ title="Posted too frequently, in multiple cities/categories, or is too commercial">
40
+ spam/overpost</a>
41
+ <br>
42
+
43
+ <a class="fl" id="flag9" href="/flag/?flagCode=9&amp;postingID=1938291834"
44
+ title="Should be considered for inclusion in the Best-Of-Craigslist">
45
+ best of craigslist</a>
46
+ <br>
47
+ </div>
48
+ </div>
49
+
50
+ <div id="tsb">
51
+ <em>Avoid scams and fraud by dealing locally!</em> Beware any deal involving Western Union, Moneygram, wire transfer, cashier check, money order, shipping, escrow, or any promise of transaction protection/certification/guarantee. <a href="http://www.craigslist.org/about/scams.html">More info</a></div>
52
+ <h2>2008 GMC Sierra 2500HD - $14800 (boston)</h2>
53
+ <hr>
54
+ Date: 2010-09-05, 6:29PM EDT<br>
55
+ Reply to: see below <br>
56
+ <hr>
57
+ <br>
58
+ <div id="userbody">
59
+ 2008 GMC SIERRA K2500 HD, Air Conditioning, Clock
60
+
61
+
62
+ Cruise Control
63
+ Dual Zone Electronic Climate Control System
64
+ Heated Seat
65
+ Homelink System
66
+ Steering Wheel Radio Controls
67
+ Sunroof
68
+ Tachometer
69
+ Tilt Steering Wheel
70
+ Tinted Windows
71
+ Power Equipment
72
+
73
+ Memory Seat Position
74
+ Power Driver's Seat
75
+ Power Locks
76
+ Power Mirrors
77
+ Power Passenger Seat
78
+ Power Steering
79
+ Power Windows
80
+
81
+ Safety Features
82
+
83
+ Anti-Lock Brakes
84
+ Driver's Air Bag
85
+ Intermittent Wipers
86
+ Keyless Entry
87
+ Passenger Air Bag
88
+ Security System
89
+ Interior
90
+
91
+ Leather Seats
92
+ Leather Steering Wheel
93
+
94
+ Audio / Video
95
+
96
+ Factory System
97
+ AM/FM
98
+ CD Player
99
+
100
+ Other Features
101
+
102
+ Tow Package
103
+
104
+ Additional Features
105
+
106
+ Heated Mirrors
107
+ OnStar
108
+ Power Adjustable Pedals
109
+ Rear Radio Control
110
+ Remote Start
111
+ Running Boards
112
+
113
+ <br>
114
+
115
+ <br>
116
+ For more details contact stephanie.gates111@gmail.com
117
+ <br>
118
+ <small><small><small><small><small><small><small><small><small><small>6104732772</small></small></small></small></small></small></small></small></small></small>
119
+ <br>
120
+ <img src="http://i866.photobucket.com/albums/ab228/rodreigo/GMC%20Sierra/used-2008-gmc-sierra_2500hd-slttruckcrewcabstandardbed-5703-5793520-2-400-1.jpg">
121
+ <br>
122
+ <img src="http://i866.photobucket.com/albums/ab228/rodreigo/GMC%20Sierra/used-2008-gmc-sierra_2500hd-slttruckcrewcabstandardbed-5703-5793520-1-400.jpg">
123
+ <br>
124
+ <img src="http://i866.photobucket.com/albums/ab228/rodreigo/GMC%20Sierra/used-2008-gmc-sierra_2500hd-slttruckcrewcabstandardbed-5703-5793520-29-640.jpg">
125
+ <br>
126
+ <img src="http://i866.photobucket.com/albums/ab228/rodreigo/GMC%20Sierra/used-2008-gmc-sierra_2500hd-slttruckcrewcabstandardbed-5703-5793520-11-640.jpg"><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small><small>;
127
+ <br> <font color="blue" face="&#148;Arial,">;key w0rds: honda acura
128
+ civic integra vtec Cars
129
+ Chevrolet, honda, toyota, dodge, bmw, acura, camry, corolla, accord,
130
+ civic, nissan, altima, maxima, lexus, passat, jetta, ford, volvo,
131
+ mazda, gas saver 2000, honda acura integra ls rs audi
132
+ type r civic BMW, Mercedez, Benz, 330i, 330xi, 330ci, bmw, m3, m5, m6 series bmw m 2005 2006 2007 2008 2009 new leather sunroof moonroof sedan coupe audi infinity acura honda
133
+ toyota lexus mazda ford cadillac 1999 2000 2001 2002 2003 2004 2005
134
+ 2006 99 00 01 02 03 04 05 06 07 08 09 sport a4 a6 a8 s4 tt allroad m3 z4 cts cts-v
135
+ deville sts xlr 300 crossfire magnum stratus viper corvette accord
136
+ civic insight s2000 g35 q45 s type x type xj super xj8 xjr
137
+ eclipse galant lancer 350z altima maxima sentra g6 a4 a6 a8 s4 tt civic, accord, race, accord,prelude,type r honda, civic, eg, 90 91 92 93 94 95 96Paleontology, palaeontology or pal�ontology (from Greek: paleo, "ancient"; ontos, "being"; and logos, "knowledge") is the study of prehistoric life forms on Earth through the examination of plant and animal fossils.[1] This includes the study of body fossils, tracks (ichnites), burrows, cast-off parts, fossilised faeces (coprolites), palynomorphs and chemical residues. Because mankind has encountered fossils for millennia, paleontology has a long history both before and after becoming formalized as a science. This article records significant discoveries and events related to paleontology that occurred in t
138
+ <br></td><!-- START CLTAGS -->
139
+
140
+
141
+ <br><br><ul class="blurbs">
142
+ <li> <!-- CLTAG GeographicArea=boston -->Location: boston
143
+ <li>it's NOT ok to contact this poster with services or other commercial interests</ul>
144
+ <!-- END CLTAGS -->
145
+ <table summary="craigslist hosted images">
146
+ <tr>
147
+ <td align="center"></td>
148
+ <td align="center"></td>
149
+ </tr>
150
+ <tr>
151
+ <td align="center"></td>
152
+ <td align="center"></td>
153
+ </tr>
154
+ </table>
155
+
156
+ </div>
157
+ PostingID: 1938291834<br>
158
+ <br>
159
+ <form action="/flag/" method="GET">
160
+ <fieldset style="display:inline;"><legend>No contact info?</legend>
161
+ <input type="hidden" name="flagCode" value="30">
162
+ <input type="hidden" name="postingID" value="1938291834">
163
+ if the poster didn't include a phone number, email, or<br>
164
+ other contact info, craigslist can notify them via email.
165
+ <input type="submit" value="Send Note!">
166
+ </fieldset>
167
+ </form>
168
+
169
+
170
+ <br>
171
+
172
+ <hr>
173
+ <ul class="clfooter">
174
+ <li>Copyright &copy; 2010 craigslist, inc.</li>
175
+ <li><a href="http://www.craigslist.org/about/terms.of.use.html">terms of use</a></li>
176
+ <li><a href="http://www.craigslist.org/about/privacy_policy">privacy policy</a></li>
177
+ <li><a href="/forums/?forumID=8">feedback forum</a></li>
178
+ </ul>
179
+
180
+ <script type="text/javascript" src="http://www.craigslist.org/js/jquery-1.4.2.js"></script>
181
+ <script type="text/javascript" src="http://www.craigslist.org/js/postings.js"></script>
182
+ <script type="text/javascript"><!--
183
+ pID = 1938291834;
184
+ -->
185
+ </script>
186
+ </body>
187
+ </html>
188
+
@@ -122,7 +122,7 @@ class CraigslistListingTest < Test::Unit::TestCase
122
122
  assert_equal false, fortmyers_art_index600_060909.posts[0].system_post?
123
123
  assert_equal "Husqvarna Viking Rose Embroidery-Sewing Machine", fortmyers_art_index600_060909.posts[0].title
124
124
 
125
- assert_equal "Multiple artists' moving sale. Lots of unusual items including art, art supplies, ceramics and ceramic glazes, furniture, clothes, books, electronics, cd's and much more. Also for sale is alot of restaurant equpment.\r<br />\n\r<br />\nSale to be held at 3570 Bayshore Dr. next to Bayshore Coffee Co.\r<br />\n\r<br />\nSaturday 8:00 a.m. until 2:00 Rain or shine.\r<br />", fortmyers_art_index600_060909.posts[1].contents
125
+ assert_equal "Multiple artists' moving sale. Lots of unusual items including art, art supplies, ceramics and ceramic glazes, furniture, clothes, books, electronics, cd's and much more. Also for sale is alot of restaurant equpment.\r<br>\n\r<br>\nSale to be held at 3570 Bayshore Dr. next to Bayshore Coffee Co.\r<br>\n\r<br>\nSaturday 8:00 a.m. until 2:00 Rain or shine.\r<br>", fortmyers_art_index600_060909.posts[1].contents
126
126
  assert_equal "Multiple artists' moving sale. Lots of unusual items including art, art supplies, ceramics and ceramic glazes, furniture, clothes, books, electronics, cd's and much more. Also for sale is alot of restaurant equpment.\r\n\r\nSale to be held at 3570 Bayshore Dr. next to Bayshore Coffee Co.\r\n\r\nSaturday 8:00 a.m. until 2:00 Rain or shine.\r", fortmyers_art_index600_060909.posts[1].contents_as_plain
127
127
  assert_equal false, fortmyers_art_index600_060909.posts[1].deleted_by_author?
128
128
  assert_equal true, fortmyers_art_index600_060909.posts[1].downloaded?
@@ -174,7 +174,7 @@ class CraigslistListingTest < Test::Unit::TestCase
174
174
  assert_equal false, fortmyers_art_index600_060909.posts[2].system_post?
175
175
  assert_equal "tapestry sewing machine and embroidery arm luggage", fortmyers_art_index600_060909.posts[2].title
176
176
 
177
- assert_equal "Gorgeous and one of a kind! Museum-collected artist Jay von Koffler's Aurora Series - cast glass nude sculpture - Aurora. Mounted on marble and enhanced with bronze beak. \r<br />\n\r<br />\nDimensions: 30x16x6\r<br />\nCall for appointment for studio viewing - 239.595.1793", fortmyers_art_index600_060909.posts[3].contents
177
+ assert_equal "Gorgeous and one of a kind! Museum-collected artist Jay von Koffler's Aurora Series - cast glass nude sculpture - Aurora. Mounted on marble and enhanced with bronze beak. \r<br>\n\r<br>\nDimensions: 30x16x6\r<br>\nCall for appointment for studio viewing - 239.595.1793", fortmyers_art_index600_060909.posts[3].contents
178
178
  assert_equal "Gorgeous and one of a kind! Museum-collected artist Jay von Koffler's Aurora Series - cast glass nude sculpture - Aurora. Mounted on marble and enhanced with bronze beak. \r\n\r\nDimensions: 30x16x6\r\nCall for appointment for studio viewing - 239.595.1793", fortmyers_art_index600_060909.posts[3].contents_as_plain
179
179
  assert_equal false, fortmyers_art_index600_060909.posts[3].deleted_by_author?
180
180
  assert_equal true, fortmyers_art_index600_060909.posts[3].downloaded?
@@ -139,7 +139,7 @@ EOD
139
139
  assert_equal [], posting0.img_types
140
140
 
141
141
  posting1 = CraigScrape::Posting.new relative_uri_for('post_samples/posting1.html')
142
- assert_equal "Residential income property\227Investors this property is for you! This duplex has a 2bedroom/1bath unit on each side. It features updated kitchens and baths (new tubs, toilet, sink, vanities), ceramic tile flooring throughout, separate water and electric meters and on site laundry facilities. It is also closed to the Galleria, beaches and downtown Fort Lauderdale! \r<br />\n\r<br />\nJe parle le Fran\347ais\r<br />\n\r<br />\nThis property is being offered by Blaunch Perrier, Broker Associate, Atlantic Properties International. Blaunch can be reached at 954-593-0077. For additional property information you may also visit www.garylanham.com\r<br />\n\r<br />", posting1.contents
142
+ assert_equal "Residential income property\227Investors this property is for you! This duplex has a 2bedroom/1bath unit on each side. It features updated kitchens and baths (new tubs, toilet, sink, vanities), ceramic tile flooring throughout, separate water and electric meters and on site laundry facilities. It is also closed to the Galleria, beaches and downtown Fort Lauderdale! \r<br>\n\r<br>\nJe parle le Fran\347ais\r<br>\n\r<br>\nThis property is being offered by Blaunch Perrier, Broker Associate, Atlantic Properties International. Blaunch can be reached at 954-593-0077. For additional property information you may also visit www.garylanham.com\r<br>\n\r<br>", posting1.contents
143
143
  assert_equal ["south florida craigslist", "broward county", "real estate - by broker"], posting1.full_section
144
144
  assert_equal "$189900 / 4br - Investment Property--Duplex in Fort Lauderdale", posting1.header
145
145
  assert_equal "$189900 / 4br - Investment Property--Duplex in Fort Lauderdale", posting1.label
@@ -156,7 +156,7 @@ EOD
156
156
  assert_equal [:pic], posting1.img_types
157
157
 
158
158
  posting2 = CraigScrape::Posting.new relative_uri_for('post_samples/posting2.html')
159
- assert_equal 15775, posting2.contents.length # This is easy, and probably fine enough
159
+ assert_equal 15488, posting2.contents.length # This is easy, and probably fine enough
160
160
  assert_equal ["south florida craigslist", "broward county", "cars & trucks - by dealer"], posting2.full_section
161
161
  assert_equal "PRESENTING A ELECTRON BLUE METALLIC 2002 CHEVROLET CORVETTE Z06 6 SPEE - $23975 (Fort Lauderdale)", posting2.header
162
162
  assert_equal "PRESENTING A ELECTRON BLUE METALLIC 2002 CHEVROLET CORVETTE Z06 6 SPEE - $23975", posting2.label
@@ -172,7 +172,7 @@ EOD
172
172
  assert_equal [:img], posting2.img_types
173
173
 
174
174
  posting3 = CraigScrape::Posting.new relative_uri_for('post_samples/posting3.html')
175
- assert_equal "1992 Twin Turbo 300ZX. This car is pearl white outside and Camel leather interior with suede accents. Motor was re-done from the ground up two years ago. 23,000 on new motor rebuild! New Leather seats and center arm rest done also two years ago. Has Alpine Am/Fm Cd with Ipod cable, Viper pager alarm New! JL Audio Amp & JLAudio sub box custom made. Mtx mids& highs component speakers sparate tweeter. Car runs strong & straight. Just detailed the interior. Exterior should be painted. This car once painted will sell for over $10,000. \r<br />\nCome get a great deal now! offers and trades will be considered. 786-303-6550 Manny", posting3.contents
175
+ assert_equal "1992 Twin Turbo 300ZX. This car is pearl white outside and Camel leather interior with suede accents. Motor was re-done from the ground up two years ago. 23,000 on new motor rebuild! New Leather seats and center arm rest done also two years ago. Has Alpine Am/Fm Cd with Ipod cable, Viper pager alarm New! JL Audio Amp & JLAudio sub box custom made. Mtx mids& highs component speakers sparate tweeter. Car runs strong & straight. Just detailed the interior. Exterior should be painted. This car once painted will sell for over $10,000. \r<br>\nCome get a great deal now! offers and trades will be considered. 786-303-6550 Manny", posting3.contents
176
176
  assert_equal ["south florida craigslist", "miami / dade", "cars & trucks - by owner"], posting3.full_section
177
177
  assert_equal "300ZX Nissan Twin Turbo 1992 - $5800 (N.Miami/ Hialeah)", posting3.header
178
178
  assert_equal "300ZX Nissan Twin Turbo 1992 - $5800", posting3.label
@@ -190,7 +190,7 @@ EOD
190
190
 
191
191
  # This one ended up being quite a curveball since the user uploaded HTML was such junk:
192
192
  posting4 = CraigScrape::Posting.new relative_uri_for('post_samples/posting4.html')
193
- assert_equal 20640, posting4.contents.length
193
+ assert_equal 19412, posting4.contents.length
194
194
  assert_equal ["south florida craigslist", "broward county", "real estate - by broker"], posting4.full_section
195
195
  assert_equal "$225000 / 3br - Palm Aire Golf Corner Unit!", posting4.header
196
196
  assert_equal "Palm Aire Golf Corner Unit!", posting4.title
@@ -200,7 +200,7 @@ EOD
200
200
  assert_equal "hous-sk9f2-1139303170@craigslist.org", posting4.reply_to
201
201
  assert_equal [0, 8, 9, 25, 4, 2009, 6, 115, true, "EDT"], posting4.post_time.to_a
202
202
  assert_equal [], posting4.pics
203
- assert_equal 6399,posting4.contents_as_plain.length
203
+ assert_equal 6396,posting4.contents_as_plain.length
204
204
  assert_equal 225000.0, posting4.price
205
205
  assert_equal ["http://fortlauderdaleareahomesales.com/myfiles/5.jpg", "http://fortlauderdaleareahomesales.com/myfiles/4.jpg", "http://fortlauderdaleareahomesales.com/myfiles/7.jpg", "http://fortlauderdaleareahomesales.com/myfiles/10.jpg", "http://fortlauderdaleareahomesales.com/myfiles/1.jpg", "http://fortlauderdaleareahomesales.com/myfiles/2.jpg", "http://fortlauderdaleareahomesales.com/myfiles/3.jpg", "http://fortlauderdaleareahomesales.com/myfiles/8.jpg", "http://fortlauderdaleareahomesales.com/myfiles/9.jpg", "http://fortlauderdaleareahomesales.com/myfiles/11.jpg", "http://fortlauderdaleareahomesales.com/myfiles/14.jpg", "http://fortlauderdaleareahomesales.com/myfiles/6.jpg"], posting4.images
206
206
  assert_equal [:img], posting4.img_types
@@ -240,7 +240,7 @@ EOD
240
240
  assert_equal [], posting_deleted.img_types
241
241
 
242
242
  posting6 = CraigScrape::Posting.new relative_uri_for('post_samples/1207457727.html')
243
- assert_equal "<p><br />Call!! asking for a new owner.<br /> no deposit required rent to own properties. <br /> <br /> Defaulting payment records are not a problem, <br /> we will help you protect the previous owners credit history! 202-567-6371 <br /><br /></p>",posting6.contents
243
+ assert_equal "<p><br>Call!! asking for a new owner.<br> no deposit required rent to own properties. <br> <br> Defaulting payment records are not a problem, <br> we will help you protect the previous owners credit history! 202-567-6371 <br><br></p>",posting6.contents
244
244
  assert_equal "Call!! asking for a new owner. no deposit required rent to own properties. Defaulting payment records are not a problem, we will help you protect the previous owners credit history! 202-567-6371 ",posting6.contents_as_plain
245
245
  assert_equal false,posting6.deleted_by_author?
246
246
  assert_equal false,posting6.flagged_for_removal?
@@ -259,7 +259,7 @@ EOD
259
259
  assert_equal [:pic], posting6.img_types
260
260
 
261
261
  brw_reb_1224008903 = CraigScrape::Posting.new relative_uri_for('post_samples/brw_reb_1224008903.html')
262
- assert_equal "Nice 3 Bedroom/ 2 Bathroom/ Garage Home in Sunrise. 1,134 square feet of living area with a 6,000 square foot lot. Wood laminate flooring throughout the entire house. House has been updated. Stamped concrete driveway which leads to garage. Big back yard. Central AC. Washer/Dryer. Not a short sale or foreclosure. Asking $189,999. Call Charles Schneider (The Best Damn Real Estate Company Period!) at 954-478-4784.\r<br />\n\r<br />\nDirections: Take Pine Island Road north off of Sunrise Boulevard (past Sunset Strip) to N.W. 25th Court. Head west (left) on N.W. 25th Court to N.W. 91st Lane. Head north (right) on N.W. 91st Lane to N.W. 26th Street. Head east (right) on N.W. 26th Street to the property- 9163 N.W. 26th Street, Sunrise, FL 33322", brw_reb_1224008903.contents
262
+ assert_equal "Nice 3 Bedroom/ 2 Bathroom/ Garage Home in Sunrise. 1,134 square feet of living area with a 6,000 square foot lot. Wood laminate flooring throughout the entire house. House has been updated. Stamped concrete driveway which leads to garage. Big back yard. Central AC. Washer/Dryer. Not a short sale or foreclosure. Asking $189,999. Call Charles Schneider (The Best Damn Real Estate Company Period!) at 954-478-4784.\r<br>\n\r<br>\nDirections: Take Pine Island Road north off of Sunrise Boulevard (past Sunset Strip) to N.W. 25th Court. Head west (left) on N.W. 25th Court to N.W. 91st Lane. Head north (right) on N.W. 91st Lane to N.W. 26th Street. Head east (right) on N.W. 26th Street to the property- 9163 N.W. 26th Street, Sunrise, FL 33322", brw_reb_1224008903.contents
263
263
  assert_equal "Nice 3 Bedroom/ 2 Bathroom/ Garage Home in Sunrise. 1,134 square feet of living area with a 6,000 square foot lot. Wood laminate flooring throughout the entire house. House has been updated. Stamped concrete driveway which leads to garage. Big back yard. Central AC. Washer/Dryer. Not a short sale or foreclosure. Asking $189,999. Call Charles Schneider (The Best Damn Real Estate Company Period!) at 954-478-4784.\r\n\r\nDirections: Take Pine Island Road north off of Sunrise Boulevard (past Sunset Strip) to N.W. 25th Court. Head west (left) on N.W. 25th Court to N.W. 91st Lane. Head north (right) on N.W. 91st Lane to N.W. 26th Street. Head east (right) on N.W. 26th Street to the property- 9163 N.W. 26th Street, Sunrise, FL 33322", brw_reb_1224008903.contents_as_plain
264
264
  assert_equal false, brw_reb_1224008903.deleted_by_author?
265
265
  assert_equal false, brw_reb_1224008903.flagged_for_removal?
@@ -280,7 +280,7 @@ EOD
280
280
  assert_equal [:pic], brw_reb_1224008903.img_types
281
281
 
282
282
  sfbay_art_1223614914 = CraigScrape::Posting.new relative_uri_for('post_samples/sfbay_art_1223614914.html')
283
- assert_equal "Bombay Company Beautiful Art Postered Painting \r<br />\n\225\tThe most beautiful piece of art you could have\r<br />\n\225\tMatches with any type of furnishing and decoration\r<br />\n\225\tA must see/Only one year old\r<br />\n\225\tRegular Price @ $1500.00\r<br />\n\225\tSale Price @ $650.00\r<br />", sfbay_art_1223614914.contents
283
+ assert_equal "Bombay Company Beautiful Art Postered Painting \r<br>\n\225\tThe most beautiful piece of art you could have\r<br>\n\225\tMatches with any type of furnishing and decoration\r<br>\n\225\tA must see/Only one year old\r<br>\n\225\tRegular Price @ $1500.00\r<br>\n\225\tSale Price @ $650.00\r<br>", sfbay_art_1223614914.contents
284
284
  assert_equal "Bombay Company Beautiful Art Postered Painting \r\n\225\tThe most beautiful piece of art you could have\r\n\225\tMatches with any type of furnishing and decoration\r\n\225\tA must see/Only one year old\r\n\225\tRegular Price @ $1500.00\r\n\225\tSale Price @ $650.00\r", sfbay_art_1223614914.contents_as_plain
285
285
  assert_equal false, sfbay_art_1223614914.deleted_by_author?
286
286
  assert_equal false, sfbay_art_1223614914.flagged_for_removal?
@@ -357,5 +357,35 @@ EOD
357
357
  assert_equal false, posting1808219423.system_post?
358
358
  assert_equal "*Software*AdobeCS5*RosettaStone*AutoCAD*Windows7*Office2010*&* More", posting1808219423.title
359
359
  end
360
+
361
+ def test_bug_found090610
362
+ posting_090610 = CraigScrape::Posting.new relative_uri_for('post_samples/posting1938291834-090610.html')
363
+
364
+ assert_equal 27629, posting_090610.contents.length
365
+ assert_equal 2326, posting_090610.contents_as_plain.length
366
+ assert_equal false, posting_090610.deleted_by_author?
367
+ assert_equal true, posting_090610.downloaded?
368
+ assert_equal false, posting_090610.flagged_for_removal?
369
+ assert_equal ["boston craigslist", "boston/camb/brook", "for sale / wanted", "arts & crafts"], posting_090610.full_section
370
+ assert_equal true, posting_090610.has_img?
371
+ assert_equal false, posting_090610.has_pic?
372
+ assert_equal true, posting_090610.has_pic_or_img?
373
+ assert_equal "2008 GMC Sierra 2500HD - $14800 (boston)", posting_090610.header
374
+ assert_equal "2008 GMC Sierra 2500HD - $14800 (boston)", posting_090610.header_as_plain
375
+ assert_equal nil, posting_090610.href
376
+ assert_equal ["http://i866.photobucket.com/albums/ab228/rodreigo/GMC%20Sierra/used-2008-gmc-sierra_2500hd-slttruckcrewcabstandardbed-5703-5793520-2-400-1.jpg", "http://i866.photobucket.com/albums/ab228/rodreigo/GMC%20Sierra/used-2008-gmc-sierra_2500hd-slttruckcrewcabstandardbed-5703-5793520-1-400.jpg", "http://i866.photobucket.com/albums/ab228/rodreigo/GMC%20Sierra/used-2008-gmc-sierra_2500hd-slttruckcrewcabstandardbed-5703-5793520-29-640.jpg", "http://i866.photobucket.com/albums/ab228/rodreigo/GMC%20Sierra/used-2008-gmc-sierra_2500hd-slttruckcrewcabstandardbed-5703-5793520-11-640.jpg"], posting_090610.images
377
+ assert_equal [:img], posting_090610.img_types
378
+ assert_equal "2008 GMC Sierra 2500HD - $14800", posting_090610.label
379
+ assert_equal "boston", posting_090610.location
380
+ assert_equal [], posting_090610.pics
381
+ assert_equal [0, 0, 0, 5, 9, 2010, 0, 248, true, "EDT"], posting_090610.post_date.to_a
382
+ assert_equal [0, 29, 18, 5, 9, 2010, 0, 248, true, "EDT"], posting_090610.post_time.to_a
383
+ assert_equal 1938291834, posting_090610.posting_id
384
+ assert_equal 14800.0, posting_090610.price
385
+ assert_equal nil, posting_090610.reply_to
386
+ assert_equal "arts & crafts", posting_090610.section
387
+ assert_equal false, posting_090610.system_post?
388
+ assert_equal "2008 GMC Sierra 2500HD", posting_090610.title
389
+ end
360
390
 
361
391
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libcraigscrape
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 3
10
- version: 0.8.3
9
+ - 4
10
+ version: 0.8.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris DeRose, DeRose Technologies, Inc.
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-02 00:00:00 -04:00
18
+ date: 2010-09-06 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -74,7 +74,7 @@ extra_rdoc_files:
74
74
  - bin/craigwatch
75
75
  files:
76
76
  - lib/libcraigscrape.rb
77
- - test/geolisting_samples/hierarchy_test071009/us/fl/miami/nonsense/index.html
77
+ - test/geolisting_samples/hierarchy_test071009/us/fl/miami/nonsense/more-nonsense/index.html
78
78
  - CHANGELOG
79
79
  - COPYING
80
80
  - COPYING.LESSER
@@ -110,6 +110,7 @@ files:
110
110
  - test/post_samples/brw_reb_1224008903.html
111
111
  - test/post_samples/posting1.html
112
112
  - test/post_samples/posting0.html
113
+ - test/post_samples/posting1938291834-090610.html
113
114
  - test/post_samples/posting5.html
114
115
  - test/post_samples/posting1796890756-061710.html
115
116
  - test/post_samples/posting3.html
@@ -123,8 +124,8 @@ files:
123
124
  - test/geolisting_samples/geo_listing_ca_sk070209.html
124
125
  - test/geolisting_samples/geo_listing_ca070209.html
125
126
  - test/geolisting_samples/geo_listing_cn070209.html
126
- - test/geolisting_samples/hierarchy_test071009/us/fl/miami/nonsense/more-nonsense/index.html
127
127
  - README
128
+ - test/geolisting_samples/hierarchy_test071009/us/fl/miami/nonsense/index.html
128
129
  - test/geolisting_samples/hierarchy_test071009/us/fl/miami/index.html
129
130
  - test/geolisting_samples/hierarchy_test071009/us/fl/nonsense/index.html
130
131
  - test/geolisting_samples/hierarchy_test071009/us/fl/south%20florida/index.html