Code Monkey home page Code Monkey logo

wheniwasyourage's Introduction

When I Was Your Age...

a.k.a. the Dad-est app ever

created by Kaley Sullivan and Chandra Galbiati

History: The idea for this app came from my father, who wanted to build a model that would allow you to see what the world was like at various points in another person's timeline. What music was MLK Jr. listening to when he was 15? What current events shaped John Lennon's young life? What sporting events did Andy Warhol watch as a child? Did Grandma really walk uphill to school both ways?

Notes:

  • Currently, only "world events" are represented in the app (other categories would be included in future versions). These "world events" were scraped from Wikipedia's "Year" pages. Though Wikipedia does offer an API and full downloads of its content, we were interested in learning web-scraping, and Wikipedia offered a simple way to explore the techniques.
  • On the front end, requests are made to the database only when the dates of the timeline are changed through the form in the top-right corner, increasing the performance of the slider and the changing display.

v 1.0 documentation

Events must be scraped into a local Postgres database in order for the app to function.

Set-up

  1. Create a new Postgres database.
  2. In database.js, edit the first 2 lines to point to your database and username
  3. Keep the database running as long as you want to use the app.

In-Browser Database API

  • Add data to the database by making a scraping request:

    http://localhost:5000/api/post/range/YYYY/ZZZZ
    
    • YYYY = first year in range, ZZZZ = last year in range, inclusive
    • For recent years (~1980s and later) we recommend limiting the range to ~5 years at a time, as the asynchronous requests may fail because of the volume of data.
  • Request data from a single year:

    http://localhost:5000/api/year/YYYY
    
  • Request data from a range of years, and a specific number of events per year:

    http://localhost:5000/api/range?min=YYYY&max=ZZZZ&perYear=N
    
    • YYYY = first year in range, ZZZZ = last year in range, inclusive, N = number of events per year

Using the App

  • Once there's data in the database, you can use the form in the top-right corner to change the timeline.
  • Move the slider to move through the person's timeline and see the top 5 events from that year.
  • Use the "See More Events" button to randomize and see more events from that year.
  • Enjoy learning about the world through someone else's eyes!

wheniwasyourage's People

Contributors

cgalbiati avatar ksullivan2 avatar

Stargazers

 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.