Skip to content

Commit

Permalink
added log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
rgtstha committed Aug 4, 2023
1 parent 1d2c880 commit f1f445f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scrapper/push_notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ admin.initializeApp({

const ipo_list = require('./ipo_list.json');
const todayDate = new Date().toISOString().slice(0, 10);
console.log("Today's date: " + todayDate);
const opening_today = ipo_list.ipo_list.filter(ipo => ipo.opening_date === todayDate);
const closing_today = ipo_list.ipo_list.filter(ipo => ipo.closing_date === todayDate);

Expand All @@ -33,6 +34,7 @@ const sendNotification = (title, body) => {
};

if (opening_today.length > 0) {
console.log("Opening today ipo length: " + opening_today.length);
opening_today.forEach(ipo => {
sendNotification("IPO Opening Today", ipo.company_name + " is opening today.");
});
Expand Down

0 comments on commit f1f445f

Please sign in to comment.