GitXplorerGitXplorer
t

lonely_coder

public
52 stars
18 forks
8 issues

Commits

List of commits on branch master.
Unverified
fc4e8293689a08cc3815886ddcf95612b2b96d05

Update to 0.1.5.1

ttrek committed 11 years ago
Unverified
fe3a8fef9e16e95d0b5cb7d4dd21a7d64a7f73f6

Fixes Authentication

ttrek committed 11 years ago
Unverified
cef6d956b281429b449db2e23f513565fc49674b

Verify that messages can read the "more messages" sections.

ttrek committed 13 years ago
Unverified
ad31deb02ef441c3cb70cd81b498ce4b3ffa643d

version bump

ttrek committed 13 years ago
Unverified
37e8fe2c2b0a29cec26cb3389a62687480c2756a

Added EthnicityFilter

ttrek committed 13 years ago
Unverified
011e6a9e44b0e6bddcfcd528f533bccd1189a0e1

Reorganized filter/parameter classes and added documentation.

ttrek committed 13 years ago

README

The README file for this repository.

Lonely Coder

,d88b.d88b,
88888888888
`Y8888888Y'
  `Y888Y'
    `Y'

Lonely coder seeks nice boy

require 'lonely_coder'
okc = OKCupid.new('thetrek','thisisntmypasswordweirdo')

sweet_guys = []

['Ann Arbor, MI', 'New York, New York',
'Chicago, Illinois', 'San Francisco, CA'].each do |maybe_here|
  sweet_guys += okc.search({
    :min_age => 25,
    :max_age => 35, # just someone around my age, yo
    :gentation => 'Guys who like guys', # don't hate
    :order_by => 'Match %', # I want us to get along, let's make it last
    :last_login => 'last month',
    :location => maybe_here,
    :radius => 25, # acceptable values are 25, 50, 100, 250, 500, nil
    :require_photo => true, # I like a goofy smile
    :relationship_status => 'single' # the heart aches, but not for friends
  }).results
end

sweet_guys.count # oof, 812. Let the coffee dates begin!

What is this nonsense?

A ruby gem for interacting with OKCupid. OKCupid doesn't actually have an API, so we use mechanize to interact with the site. Screen scraping isn't terribly fast, but it's pretty zippy compared to the other option – doing nothing.

How does it work?

You'll need an OKCupid account (it's free) because most of the site is behind authentication. You can create a new connection to the site.

Install as a gem

gem install lonely_coder

Use your account

require 'lonely_coder'
okc = OKCupid.new('yourusername', 'yourpassword')

Once you have a connection you can check out a person's profile

trek = okc.profile_for('thetrek')
trek.match # => 99. Damn, he's pretty sweet
trek.location # => 'Ann Arbor, Michigan'
`open #{trek.profile_thumb_urls.first}` # HOT. DAMN.

Go ahead and ask for username, match, friend, enemy, location, age, sex, orientation, relationship_status, relationship_type, last_online, ethnicity, height, body_type, diet, smokes, drinks, drugs, religion, sign, education, job, income, offspring, pets, speaks, and profile_thumb_urls

If you don't have particular username in mind, you can search. Check lib/magic_constants.rb for the crazy [Magic Numbers](http://en.wikipedia.org/wiki/Magic_number_(programming\)).

search = okc.search({
  :min_age => 18,
  :max_age => 99,
  :gentation => 'guys who like guys',
  :ethnicity => ['human']
}) # search object

# fires the loading of the first 10, but only limited profiles. If you'd like full
# deets, use okc.profile_for with a results username.
search.results
search.load_next_page # loads the next 10 results

What if things don't go well

okc.love(1000) # ♥