GithubHelp home page GithubHelp logo

nathanielwroblewski / is-nate-alive Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 14.89 MB

An endpoint to display whether Nate is alive or not

Home Page: http://nathanielwroblewski.github.io/is-nate-alive

CSS 19.47% JavaScript 80.53%

is-nate-alive's Introduction

Is Nate Alive?

An endpoint to display whether Nate is alive or not

Screenshot

Check-in Flow

To check-in, I added a link to my phone's homescreen that hits a Torpio webhook. This webhook updates Firebase, a real-time NoSQL cloud database, via Zapier, a sort of API for APIs.

Check-in: Link → Torpio → Zapier → Firebase

Pull date: Website ← Firebase

Services

  • Torpio webhook - when visited, parses todays date and send it to a Zapier webhook
  • Zapier webhook - when visited, updates a record in firebase with the date parameter passed to it
  • Firebase - Stores a single entry with a date field
  • Website - when visited, pulls record from Firebase and sets the date on the page

Code needed for check-in on website

var firebase = new Firebase(FIREBASE_URL)

firebase.on('child_added', function(snapshot) {
  var checkin = snapshot.val()
  document.getElementById('date').innerHTML = checkin.date
})

Code needed for check-in on Torpio Webhook

var date = new Date().toLocaleTimeString('en-us', {
  hour:    '2-digit',
  minute:  '2-digit',
  weekday: 'short',
  year:    'numeric',
  month:   'short',
  day:     'numeric',
  hour12:  true
})
  , zapierWebhook = 'https://zapier.com/hooks/catch/ow7wcu/?date='

if (datetime) http.get(zapierWebhook + date, function(error, response, body) {
  log.info(error, response, body, date)
})

is-nate-alive's People

Contributors

nathanielwroblewski avatar

Stargazers

Fab Mackojc avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

is-nate-alive's Issues

awkward

It could be a very sad pull request for nope should the time come.

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.