GithubHelp home page GithubHelp logo

lonely_coder's Introduction

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) # ♥

lonely_coder's People

Contributors

trek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.