Skip to content

Instantly share code, notes, and snippets.

View benjaminlukeclark's full-sized avatar
:octocat:

Benjamin Clark benjaminlukeclark

:octocat:
View GitHub Profile
@benjaminlukeclark
benjaminlukeclark / recurring_maintenance_windows.py
Created July 23, 2021 14:44 — forked from lfepp/recurring_maintenance_windows.py
Script to create a number of recurring maintenance windows in PagerDuty
#!/usr/bin/env python
#
# Copyright (c) 2016, PagerDuty, Inc. <info@pagerduty.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
#Run this every 1/2 hour and in an 8 hour work day there will be approximately 3 times per day that your victim hears a cat fact
if ((Get-Random -Maximum 10000) -lt 1875) {
Add-Type -AssemblyName System.Speech
$SpeechSynth = New-Object System.Speech.Synthesis.SpeechSynthesizer
$Random = Get-Random -Maximum 200
$CatFact = (ConvertFrom-Json (Invoke-WebRequest -Uri http://www.catfact.info/api/v1/facts.json?per_page=200)).Facts[$Random]
$SpeechSynth.Speak("did you know?")
$SpeechSynth.Speak($CatFact.details)
}