olek-libcraigscrape 1.1.0.3 → 1.1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/listings.rb +2 -2
  2. metadata +1 -1
data/lib/listings.rb CHANGED
@@ -72,7 +72,7 @@ class CraigScrape::Listings < CraigScrape::Scraper
72
72
  if html.at_xpath(XPATH_PAGENAV_LINKS)
73
73
  # Post 12/3
74
74
  next_link = html.xpath(XPATH_PAGENAV_LINKS).find{|link| NEXT_PAGE_LINK.match link.content}
75
- @next_page_href = next_link[:href]
75
+ @next_page_href = next_link[:href] if next_link
76
76
  else
77
77
  # Old style
78
78
  cursor = html.at 'p:last-of-type'
@@ -111,7 +111,7 @@ class CraigScrape::Listings < CraigScrape::Scraper
111
111
 
112
112
  # Returns a Listings object of the next_page_url on the current listings object
113
113
  def next_page
114
- CraigScrape::Listings.new next_page_url if next_page_url
114
+ CraigScrape::Listings.new URI.encode(next_page_url) if next_page_url
115
115
  end
116
116
 
117
117
  # Takes a paragraph element and returns a mostly-parsed Posting
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: olek-libcraigscrape
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.3
4
+ version: 1.1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: