Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made changes to get_instance method #24

Merged
merged 1 commit into from
Nov 16, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions lib/upton.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,12 @@ def get_index_pages(url, pagination_index, options={})
##
def get_instance(url, pagination_index=0, options={})
resp = self.get_page(url, @debug, options)
if !resp.empty?
next_url = self.next_instance_page_url(url, pagination_index.to_i + 1)

#next_url = resolve_url(next_url, url)
unless next_url == url
next_resp = self.get_instance(next_url, pagination_index.to_i + 1).to_s
resp += next_resp
end
i = pagination_index.to_i
while !resp.empty?
next_url = self.next_instance_page_url(url, i += 1)
next_resp = self.get_page(next_url, @debug, options)
break if next_url == url
resp += next_resp
end
resp
end
Expand Down