GithubHelp home page GithubHelp logo

grcote / conspire-inspired Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gschool/conspire-inspired

0.0 1.0 0.0 183 KB

A Ruby exercise inspired by Conspired (https://www.goconspire.com/)

License: Other

Ruby 100.00%

conspire-inspired's Introduction

Conspire-Inspired

Conspire is an incredibly cool app. It scans your inbox, and allows you to see the various ways in which you are connected to other people based on your email history and the history of other people who also use Conspire.

The goal of this exercise is to create an algorithm inspired by Conspire. Your mission, should you choose to accept it, is to figure out the relationships between people, purely based on their emails.

Your code should be able to:

  • take an email address
  • read through all of the emails in a given directory
  • return data about each person the given email address has interacted with

Challenges

Imagine two people: Sue and Joe.

Find Current Friends

We would say Sue is Joe's current friend if:

  • Sue has sent 3 or more emails to Joe (ever)
  • Joe has replied to 2 out of the last 3 emails
  • The last email is within 2 weeks of today

We would also say the inverse is true. So if Sue has sent 3 emails, Joe replied to at least 2 of the last 3 and the latest was within the last 2 weeks, Sue would be his current friend.

Find Old Friends

We would say Sue is Joe's old friend if:

  • Sue has sent 3 or more emails to Joe (ever)
  • Joe replied to 2 out of every 3 emails
  • The last email between them is later than 2 weeks ago

And the inverse would be true as well.

Example

Your code should look something like this:

SomeClass.new('data').relationships('[email protected]')

and should return a result like this:

{
  "[email protected]" => "Current Friend",
  "[email protected]" => "Old Friend",
  "[email protected]" => "Old Friend",
}

Checking your work

When you run your code against the files generated by rake generate, you should get the following:

Using the Mail gem

Use the Mail Gem to parse the emails. Mail.read will probably get you what you need.

Generating test data

  • rake generate to generate sample data in the data directory
  • See Rakefile for examples of how to create Mail objects (useful for specs)

Setup

  • Fork
  • Clone
  • Turn on TravisCI for the fork by visiting https://travis-ci.org/profile/, clicking the "Sync now" button and scrolling down to find the repository to build.
  • Create a new branch for your work using git checkout -b v1
  • Implement specs and code
  • Push using git push -u origin v1

Further Practice

This warmup can be completed multiple times to increase your comfort level with the material. To work on this from scratch, you can:

  1. Add an upstream remote that points to the original repo git remote add upstream [email protected]:gSchool/THIS-REPO.git
  2. Fetch the latest from the upstream remote using git fetch upstream
  3. Create a new branch from the master branch of the upstream remote git checkout -b v2 upstream/master
  4. Implement specs and code
  5. Push using git push -u origin v2

Each time you do the exercise, create a new branch. For example the 3rd time you do the exercise the branch name will be v3 instead of v2.

conspire-inspired's People

Contributors

grcote avatar

Watchers

 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.