Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Change regex style to account for no matches #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion lib/lonely_coder/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def results

# Stores the OKCupid server timestamp. Without this, pagination returns
# inconsistent results.
@timekey = page.search('script')[0].text.match(/CurrentGMT = new Date\(([\d]+)\*[\d]+\)/).captures[0]
@timekey = page.search('script')[0].text[/CurrentGMT = new Date\(([\d]+)\*[\d]+\)/, 0]

# OKCupid may return previously found profiles if there aren't enough
# to fill a query or pagination, so we stop that with a set.
Expand Down