Skip to content

NathanielWroblewski/is-nate-alive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
})

About

An endpoint to display whether Nate is alive or not

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages