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

additional methods + update functionality #8

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
removing various todos
  • Loading branch information
nquinlan committed Mar 22, 2014
commit 46837b23878613f364a94df9368e93116e00655a
5 changes: 1 addition & 4 deletions lib/lonely_coder/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,14 @@ def Profile.get_new_likes(username, browser)
index = text.index(' people')
likes = text[0, index].to_i

# todo: get the old likes (do old likes - likes and return new likes)

return likes
end

def Profile.get_new_visitors(username, previous_timestamp = 1393545600, browser)
html = browser.get("http://www.okcupid.com/visitors")
visitors = html.search(".user_list .extra_info .last_visited script")
new_visitors = 0
# previous_timestamp = 1393545600 # todo: get the date when last scraped
# previous_timestamp = 1393545600

visitors.each { |visitor|
new_visitor = visitor.text
Expand All @@ -88,7 +86,6 @@ def Profile.get_new_visitors(username, previous_timestamp = 1393545600, browser)
end
}

# todo: set the date when last scraped + save number of visitors
return new_visitors
end

Expand Down