How it works

Thanks to CharleStock Investment Applet, monitoring your portfolios has never been easier. Get notified of the closing price of any stock you want, if the price of a stock rises/drops above/below an amount you chose, of today's price rises/drops by percentage or get even notified of today's exchange rate for any two currencies at the time of your choosing.

But how does it work ?

If This Then That (IFTTT) Webhooks allow us to use multiple Applets. Indeed thanks to Webhooks we can trigger multiple services with only one action. What's wonderful is that we can reproduce this action as many times as we want and for as many actions as we want.

For example, we could create an Applet with IF condition set as "Price at close" for a specific stock. For the THEN select Webhooks and use the "Make a web request" action. Once we've done this, create a new applet with IF condition set as Webhooks and use the "request a web action". For the THEN condition select email and then send me an email. We will then repeat this for as many services as we want, for example connect Webhook with sms. And there you have it, now we will receive the closing price of the choosen stock everyday by mail AND by sms. Of course, we can also set our initial condition for today's exchange rate for EUR/USD at 03:00 pm and get notified via sms AND email.

Documentation

My main source for creating this amazing service was https://medium.com/glitch/how-to-trigger-multiple-applets-in-ifttt-5877860a76af.

Let's see now how exactly we are going to set our Applets in motion:

  • Go to https://ifttt.com/discover and create a new Applet
  • For the IF condition select "Finance", "Price at close", "AAPL" (for example, closing price of Apple)
  • For the THEN condition select "Webhooks", "Make a web request" then complete action fiels as follows :

  • Note : Set the URL to your own Glitch project URL

  • From your Webhooks settings page in IFTTT, copy and paste the URL value for the IFTTT_MAKER_URL variable into the .env file in your Glitch project.
  • Now for each action that we'll want our Glitch app to trigger we need to create a new applet in IFTTT
  • For the IF condition select "Webhooks", "Receive a web request", set an event name (for example "stockemail") and paste that same name against IFTTT_EVENT_1= in the .env file
  • For the THEN condition select "Email", "send me an email" then complete action fiels as follows :
  • Repeat this for each action that you want to trigger. For example let's add a sms notification, For the IF condition selecet "webhooks", "Receive a web request", name "stocksms" and paste it against IFTTT_EVENT_2 in the .env file. For the THEN condition "SMS", connect with the PIN received after you gave your international number, "Send me an SMS" then complete action fiels as follows:

  • That's it, in our example we've configured our Glitch app to trigger multiple IFTTT applets when it gets triggered. So now, at the close of the NASDAQ we will receive via email AND via sms a notification telling us the closing price of Apple.

    The beauty of it all lies in the fact that we can multiple the number of notification that we want according to our needs and desires by multiplying the number of interaction with IFTTT Webhooks.

    In the end, in terms of code, our .env file should look like this :

    Our package.json file should look like this :

    Finally, our server.js file should look like this :