Code Monkey home page Code Monkey logo

event_manager's Introduction

Event Manager

This is the Event Manager tutorial for The Odin Project, you can view the tutorial here.

Why We're Doing in This Tutorial

Imagine that a friend of yours runs a non-profit organization around political activism. A number of people have registered for an upcoming event. She has asked for your help in engaging these future attendees. For the first task, she wants you to find the government representatives for each attendee based on their zip code.

Learning Goals

After completing this tutorial, you will be able to:

  • manipulate file input and output
  • read content from a CSV (Comma Separated Value) file
  • transform it into a standardized format
  • utilize the data to contact a remote service
  • populate a template with user data
  • manipulate strings
  • access Google’s Civic Information API through the Google API Client Gem
  • use ERB (Embedded Ruby) for templating

Assignment: Clean Phone Numbers

Similar to the zip codes, the phone numbers suffer from multiple formats and inconsistencies. If we wanted to allow individuals to sign up for mobile alerts with the phone numbers, we would need to make sure all of the numbers are valid and well-formed.

  • If the phone number is less than 10 digits, assume that it is a bad number
  • If the phone number is 10 digits, assume that it is good
  • If the phone number is 11 digits and the first number is 1, trim the 1 and use the first 10 digits
  • If the phone number is 11 digits and the first number is not 1, then it is a bad number
  • If the phone number is more than 11 digits, assume that it is a bad number

Assignment: Time Targeting

The boss is already thinking about the next conference: “Next year I want to make better use of our Google and Facebook advertising. Find out which hours of the day the most people registered, so we can run more ads during those hours.” Interesting!

Using the registration date and time we want to find out what the peak registration hours are.

  • Ruby has Date and Time classes that will be very useful for this task.

  • For a quick overview, check out this Ruby Guides article.

  • Explore the documentation to become familiar with the available methods, especially #strptime, #strftime, and #hour.

Assignment: Day of the Week Targeting

The big boss gets excited about the results from your hourly tabulations. It looks like there are some hours that are clearly more important than others. But now, tantalized, she wants to know “What days of the week did most people register?”

  • Use Date#wday to find out the day of the week.

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.