Node JS Automatically get update when a user goes live

Could I poll for every 2 min, and check the “created_at” stat and compare it to local time? If it was made within the last 2 min, run code?