mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 00:13:36 +01:00
Add write-saying.ps1 and speak-saying.ps1
This commit is contained in:
parent
d57ff61273
commit
b1b52dc03a
69
Data/sayings.csv
Normal file
69
Data/sayings.csv
Normal file
@ -0,0 +1,69 @@
|
||||
Joke
|
||||
"Chuck Norris doesnt read books. He stares them down until he gets the information he wants."
|
||||
"Time waits for no man. Unless that man is Chuck Norris."
|
||||
"If you spell Chuck Norris in Scrabble, you win. Forever."
|
||||
"Chuck Norris breathes air five times a day."
|
||||
"In the Beginning there was nothing then Chuck Norris roundhouse kicked nothing and told it to get a job."
|
||||
"Chuck Norris has a mug of nails instead of coffee in the morning."
|
||||
"If Chuck Norris were to travel to an alternate dimension in which there was another Chuck Norris and they both fought, they would both win."
|
||||
"The dinosaurs looked at Chuck Norris the wrong way once. You know what happened to them."
|
||||
"Chuck Norris tears cure cancer. Too bad he has never cried."
|
||||
"Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light"
|
||||
"Since 1940, the year Chuck Norris was born, roundhouse kick related deaths have increased 13,000 percent."
|
||||
"Chuck Norris does not own a stove, oven, or microwave , because revenge is a dish best served cold."
|
||||
"Chuck Norris does not sleep. He waits."
|
||||
"There is no chin behind Chuck Norris beard. There is only another fist."
|
||||
"The chief export of Chuck Norris is pain."
|
||||
"Chuck Norris recently had the idea to sell his pee as a canned beverage. Its now called Red Bull."
|
||||
"If paper beats rock, rock beats scissors, and scissors beats paper, what beats all 3 at the same time? Chuck Norris."
|
||||
"On the 7th day, God rested Chuck Norris took over."
|
||||
"Chuck Norris can dribble a bowling ball."
|
||||
"Chuck Norris drinks napalm to fight his heartburn."
|
||||
"Chuck Norris roundhouse kick is so powerful, it can be seen from outer space by the naked eye."
|
||||
"If you want a list of Chuck Norris enemies, just check the extinct species list."
|
||||
"Chuck Norris has never blinked in his entire life. Never."
|
||||
"Chuck Norris does not use spell check. If he happens to misspell a word, Oxford will change the spelling."
|
||||
"Some kids pee their name in the snow. Chuck Norris can pee his name into concrete."
|
||||
"Chuck Norris counted to infinity twice."
|
||||
"Chuck Norris can speak Braille."
|
||||
"Chuck Norris can have both feet on the ground and kick butt at the same time."
|
||||
"Chuck Norris can do a wheelie on a unicycle."
|
||||
"Chuck Norris stands faster than anyone can run."
|
||||
"Once a cobra bit Chuck Norris leg. After five days of excruciating pain, the cobra died."
|
||||
"Chuck Norris once won a game of Connect Four in three moves."
|
||||
"Champions are the breakfast of Chuck Norris."
|
||||
"When the Boogeyman goes to sleep every night he checks his closet for Chuck Norris."
|
||||
"Chuck Norris can slam revolving doors."
|
||||
"Chuck Norris does not hunt because the word hunting implies the possibility of failure. Chuck Norris goes killing."
|
||||
"The dark is afraid of Chuck Norris."
|
||||
"Chuck Norris makes onions cry."
|
||||
"Death once had a near-Chuck-Norris experience."
|
||||
"When Chuck Norris writes, he makes paper bleed."
|
||||
"Chuck Norris can strangle you with a cordless phone."
|
||||
"Chuck Norris never retreats; He just attacks in the opposite direction."
|
||||
"Chuck Norris can build a snowman out of rain."
|
||||
"Chuck Norris can drown a fish."
|
||||
"When Chuck Norris enters a room, he doesnt turn the lights on, he turns the dark off."
|
||||
"The only time Chuck Norris was ever wrong was when he thought he had made a mistake."
|
||||
"Chuck Norris is the only person that can punch a cyclops between the eye."
|
||||
"Chuck Norris used to beat up his shadow because it was following to close. It now stands 15 feet behind him."
|
||||
"Outer space exists because its afraid to be on the same planet with Chuck Norris."
|
||||
"When Chuck Norris does a pushup, he's pushing the Earth down."
|
||||
"Chuck Norris doesnt wear a watch. He decides what time it is."
|
||||
"Chuck Norris does not get frostbite. Chuck Norris bites frost."
|
||||
"Chuck Norris spices up his steaks with pepper spray."
|
||||
"The Great Wall of China was originally created to keep Chuck Norris out. It didn't work."
|
||||
"Chuck Norris can get in a bucket and lift it up with himself in it."
|
||||
"Chuck Norris doesn't shower, he only takes blood baths."
|
||||
"Chuck Norris can divide by zero."
|
||||
"Chuck Norris once kicked a horse in the chin. Its descendants are now known as giraffes."
|
||||
"When Chuck Norris does division, there are no remainders."
|
||||
"It takes Chuck Norris 20 minutes to watch '60 Minutes'."
|
||||
"Chuck Norris once went skydiving, but promised never to do it again. One Grand Canyon is enough."
|
||||
"We live in an expanding universe. All of it is trying to get away from Chuck Norris."
|
||||
"Chuck Norris beat the sun in a staring contest."
|
||||
"Chuck Norris can clap with one hand."
|
||||
"Chuck Norris doesn't need to shave. His beard is scared to grow."
|
||||
"Chuck Norris invented airplanes because he was tired of being the only person that could fly."
|
||||
"Freddy Krueger has nightmares about Chuck Norris."
|
||||
"Chuck Norris can start a fire with an ice cube."
|
|
@ -142,7 +142,6 @@ make-repo.ps1, builds the current/given Git repository
|
||||
make-repos.ps1, builds all Git repositories under the current/given directory
|
||||
moon.ps1, prints the current moon phase
|
||||
mute-audio.ps1, mutes audio
|
||||
next-joke.ps1], gets the next random Juck Norris joke
|
||||
open-browser.ps1, starts the default Web browser
|
||||
open-calculator.ps1, starts the calculator program
|
||||
open-email-client.ps1, starts the default email client
|
||||
@ -186,7 +185,8 @@ speak-file.ps1, speaks the content of the given text file by text-to-speech (TTS
|
||||
speak-french.ps1, speaks the given text with a French text-to-speech (TTS) voice
|
||||
speak-german.ps1, speaks the given text with a German text-to-speech (TTS) voice
|
||||
speak-italian.ps1, speaks the given text with an Italian text-to-speech (TTS) voice
|
||||
speak-joke.ps1, speaks the next joke by text-to-speech (TTS)
|
||||
speak-joke.ps1, speaks a random Chuck Norris joke by text-to-speech (TTS)
|
||||
speak-saying.ps1, speaks a random saying by text-to-speech (TTS)
|
||||
speak-test.ps1, performs a speak test by text-to-speech (TTS)
|
||||
speak-text.ps1, speaks the given text by text-to-speech (TTS)
|
||||
speak-time.ps1, speaks the current time by text-to-speech (TTS)
|
||||
@ -214,12 +214,14 @@ write-big.ps1, writes the given text in big letters
|
||||
write-blue.ps1, writes the given text in a blue foreground color
|
||||
write-braille.ps1, writes the given text in Braille
|
||||
write-green.ps1, writes the given text in a green foreground color
|
||||
write-joke.ps1], writes a random Juck Norris joke
|
||||
write-lowercase.ps1, writes the given text in lowercase letters
|
||||
write-marquee.ps1, writes the given text as marquee
|
||||
write-morse-code.ps1, writes the given text in Morse code
|
||||
write-motd.ps1, writes the message of the day (MOTD)
|
||||
write-red.ps1, writes the given text in a red foreground color
|
||||
write-rot13.ps1, encodes or decodes the given text with ROT13
|
||||
write-saying.ps1], writes a random saying
|
||||
write-typewriter.ps1, writes the given text with the typewriter effect
|
||||
write-uppercase.ps1, writes the given text in uppercase letters
|
||||
write-vertical.ps1, writes the given text in vertical direction
|
||||
|
Can't render this file because it has a wrong number of fields in line 79.
|
@ -27,6 +27,7 @@ Mega Collection of PowerShell Scripts
|
||||
* [speak-german.ps1](Scripts/speak-german.ps1) - speaks the given text with a German text-to-speech (TTS) voice
|
||||
* [speak-italian.ps1](Scripts/speak-italian.ps1) - speaks the given text with an Italian text-to-speech (TTS) voice
|
||||
* [speak-joke.ps1](Scripts/speak-joke.ps1) - speaks a random Chuck Norris joke by text-to-speech (TTS)
|
||||
* [speak-saying.ps1](Scripts/speak-saying.ps1) - speaks a random saying by text-to-speech (TTS)
|
||||
* [speak-test.ps1](Scripts/speak-test.ps1) - performs a speak test by text-to-speech (TTS)
|
||||
* [speak-text.ps1](Scripts/speak-text.ps1) - speaks the given text by text-to-speech (TTS)
|
||||
* [speak-time.ps1](Scripts/speak-time.ps1) - speaks the current time by text-to-speech (TTS)
|
||||
@ -240,13 +241,14 @@ Mega Collection of PowerShell Scripts
|
||||
* [write-blue.ps1](Scripts/write-blue.ps1) - writes the given text in a blue foreground color
|
||||
* [write-braille.ps1](Scripts/write-braille.ps1) - writes the given text in Braille
|
||||
* [write-green.ps1](Scripts/write-green.ps1) - writes the given text in a green foreground color
|
||||
* [write-lowercase.ps1](Scripts/write-lowercase.ps1) - writes the given text in lowercase letters
|
||||
* [write-joke.ps1](Scripts/write-joke.ps1) - writes a random Juck Norris joke
|
||||
* [write-lowercase.ps1](Scripts/write-lowercase.ps1) - writes the given text in lowercase letters
|
||||
* [write-marquee.ps1](Scripts/write-marquee.ps1) - writes the given text as marquee
|
||||
* [write-morse-code.ps1](Scripts/write-morse-code.ps1) - writes the given text in Morse code
|
||||
* [write-motd.ps1](Scripts/write-motd.ps1) - writes the message of the day (MOTD)
|
||||
* [write-red.ps1](Scripts/write-red.ps1) - writes the given text in a red foreground color
|
||||
* [write-rot13.ps1](Scripts/write-rot13.ps1) - encodes or decodes the given text with ROT13
|
||||
* [write-saying.ps1](Scripts/write-saying.ps1) - writes a random saying
|
||||
* [write-typewriter.ps1](Scripts/write-typewriter.ps1) - writes the given text with the typewriter effect
|
||||
* [write-uppercase.ps1](Scripts/write-uppercase.ps1) - writes the given text in uppercase letters
|
||||
* [write-vertical.ps1](Scripts/write-vertical.ps1) - writes the given text in vertical direction
|
||||
|
28
Scripts/speak-saying.ps1
Executable file
28
Scripts/speak-saying.ps1
Executable file
@ -0,0 +1,28 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
speak-saying.ps1
|
||||
.DESCRIPTION
|
||||
Speaks a random saying by text-to-speech (TTS)
|
||||
.EXAMPLE
|
||||
PS> .\speak-saying.ps1
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz
|
||||
License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
$Table = import-csv "$PSScriptRoot/../Data/saying.csv"
|
||||
|
||||
$Generator = New-Object System.Random
|
||||
$Index = [int]$Generator.next(0,66)
|
||||
|
||||
$Joke = $Table[$Index].Joke
|
||||
|
||||
& "$PSScriptRoot/speak-english.ps1" "$Joke"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
27
Scripts/write-saying.ps1
Executable file
27
Scripts/write-saying.ps1
Executable file
@ -0,0 +1,27 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
write-saying.ps1
|
||||
.DESCRIPTION
|
||||
Writes a random saying to the console.
|
||||
.EXAMPLE
|
||||
PS> .\write-saying.ps1
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz
|
||||
License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
$Table = import-csv "$PSScriptRoot/../Data/sayings.csv"
|
||||
|
||||
$Generator = New-Object System.Random
|
||||
$Index = [int]$Generator.next(0,66)
|
||||
|
||||
$Line = $Table[$Index].Saying
|
||||
"📣 $Line"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user