Total number of automations and total saved hours

hi

How to code in ‘execute a script’ action to get number of automations and saved hours under an organization? to mimic this