From 2675be16ffdbce522d874772be5cbaa4b728ee5b Mon Sep 17 00:00:00 2001 From: Aszure Date: Tue, 2 Oct 2018 16:17:27 +1000 Subject: [PATCH 1/4] Added Baboon Facts --- README.md | 1 + animalfacts.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index dfea5c1..cfc1881 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ You can see the bot in action at https://www.reddit.com/user/AnimalFactsBot/comm * Armadillo * Atlantic puffin * Badger +* Baboon * Bear * Beaver * Bison diff --git a/animalfacts.py b/animalfacts.py index 4d5fd27..1ab2925 100644 --- a/animalfacts.py +++ b/animalfacts.py @@ -227,6 +227,7 @@ def check_comment_for_animal(comment, reddit): botengine('atlantic puffin', '\spuffins?\s', reddit, ATLANTIC_PUFFIN_FACTS, comment) botengine('honeybadger', '\shoney badgers?\s', reddit, HONEYBADGER_FACTS, comment) # Needs to be here out of order so that it gets picked up before regular badger botengine('badger', '\sbadgers?\s', reddit, BADGER_FACTS, comment) + botengine('baboon', '\sbaboon?\s', reddit, BABOON_FACTS, comment) botengine('bear', '\sbears?\s', reddit, BEAR_FACTS, comment) botengine('beaver', '\sbeavers?\s', reddit, BEAVER_FACTS, comment) botengine('buffalo', '\sbuffalos?\s', reddit, BUFFALO_FACTS, comment) @@ -634,6 +635,17 @@ def animalfactsbot(reddit): 'Badgers were eaten in Britain during World War II and were once part of the Native American and settlers diets in the US. Russia still eats badger meat today.', 'Badgers have featured in lots of British literature over the years, such as Brian Jacques\' Redwall series, \'Tommy Brock\' in Beatrix Potter\'s The Tale of Mr. Tod, \'Bill Badger\' in Mary Tourtel\'s Rupert Bear, \'Mr. Badger\' in Kenneth Grahame\'s The Wind in the Willows, and \'Trufflehunter\' in C. S. Lewis\'s Chronicles of Narnia.', ) + +BABOON_FACTS = ( + 'Male baboons are two times larger than females. Baboons can reach 14 to 30 inches in height at the shoulder and 50 to 100 pounds in weight.', + 'Bodies of baboons are covered with fur that can be dark olive or yellow in color. Males and females look alike, except that females do not have long hair around their necks.', + 'Baboons have long, dog-like muzzle and strong jaw equipped with sharp canines.', + 'Baboons are mainly terrestrial animals (live on the ground). They travel large distances in the early morning and late afternoon in the search for food.', + 'Baboons live in groups called troops. They consist of 7-8 males, twice as many females and their offspring. Dominance in the troop is established via fights.', + 'Baboons use 30 different sounds for communication. They are able to grunt, scream and bark. Besides vocalization, baboons can yawn, smack their lips or shrug their shoulder to communicate.', + 'Baboons can survive up to 30 years in the wild and up to 45 years in captivity.', + 'Baboons reach sexual maturity between the age 5 and 8. Young males leave their native groups, while females stay.', + ) BEAR_FACTS = ( 'There are eight different species of bear! The North American Black Bear, the Brown Bear, the Polar Bear, the Asiatic Black Bear, the Spectacled Bear, the Giant Panda, the Sloth Bear, and the Sun Bear!', @@ -3018,6 +3030,7 @@ def animalfactsbot(reddit): ARMADILLO_FACTS, AXOLOTL_FACTS, BADGER_FACTS, + BABOON_FACTS, BEAR_FACTS, BEAVER_FACTS, BUFFALO_FACTS, From 98b607683daca0e7be8c1d817df5962a502adf2d Mon Sep 17 00:00:00 2001 From: Aszure Date: Tue, 2 Oct 2018 17:55:22 +1000 Subject: [PATCH 2/4] Added more Pufferfish and Quokka Facts --- animalfacts.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/animalfacts.py b/animalfacts.py index 1ab2925..2d32d68 100644 --- a/animalfacts.py +++ b/animalfacts.py @@ -2302,6 +2302,9 @@ def animalfactsbot(reddit): 'Scientists believe that puffer fish developed their puffing tactic as a method of self defense because they are poor swimmers that cannot escape from danger quickly.', 'Sharks are the only species immune to the puffer fish\'s toxin. They can eat puffer fish without any negative consequences', 'Puffer fish do not have scales. Their skin is thick and rough. Some species have spines on their skin, which offer additional protection against predators.', + 'Puffer fish can be discretely or brightly colored. There is often relationship between the body coloration and the amount of toxin produced by the fish (brighter colors are often associated with large quantity of toxin in the fish).', + 'Puffer fish have four teeth that are fused in the beak-like structure. They use their teeth for opening of mussels, clams and shellfish. Puffer fish also eat algae and different types of worms and crustaceans.', + 'One puffer fish contains enough toxin to kill 30 adult men.' ) PORCUPINE_FACTS = ( @@ -2331,6 +2334,9 @@ def animalfactsbot(reddit): 'Quokkas do not fear humans and will approach people closely if you visit them on Rottnest Island. However, it is illegal for humans to handle or feed them.', 'Rottnest Island in Australia, where many quokkas live, was given its name when a Dutch explorer mistook the quokkas for rats. The name means "rat nest" in Dutch.', 'A baby quokka is called a joey. Females can give birth to joeys twice a year. The joey will live in the pouch of its mother for six months.', + 'The average lifespan of a Quokka is 10 years.', + 'Quokkas have sharp teeth and will shriek if cornered or attacked or if they feel threatened or provoked.', + 'The quokkas lack of fear of humans and the small size of their natural habitat makes them vulnerable to becoming endangered as a species.', ) RABBIT_FACTS = ( From 9e23aecc842ebe551b5715fa6b7a1d302d9c3e45 Mon Sep 17 00:00:00 2001 From: Mark Pentler Date: Fri, 11 Jan 2019 23:41:19 +0000 Subject: [PATCH 3/4] Update animalfacts.py Corrected some spellings, grammar, and indentation issues. Also a comma. --- animalfacts.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/animalfacts.py b/animalfacts.py index 2d32d68..986ed67 100644 --- a/animalfacts.py +++ b/animalfacts.py @@ -227,7 +227,7 @@ def check_comment_for_animal(comment, reddit): botengine('atlantic puffin', '\spuffins?\s', reddit, ATLANTIC_PUFFIN_FACTS, comment) botengine('honeybadger', '\shoney badgers?\s', reddit, HONEYBADGER_FACTS, comment) # Needs to be here out of order so that it gets picked up before regular badger botengine('badger', '\sbadgers?\s', reddit, BADGER_FACTS, comment) - botengine('baboon', '\sbaboon?\s', reddit, BABOON_FACTS, comment) + botengine('baboon', '\sbaboon?\s', reddit, BABOON_FACTS, comment) botengine('bear', '\sbears?\s', reddit, BEAR_FACTS, comment) botengine('beaver', '\sbeavers?\s', reddit, BEAVER_FACTS, comment) botengine('buffalo', '\sbuffalos?\s', reddit, BUFFALO_FACTS, comment) @@ -639,7 +639,7 @@ def animalfactsbot(reddit): BABOON_FACTS = ( 'Male baboons are two times larger than females. Baboons can reach 14 to 30 inches in height at the shoulder and 50 to 100 pounds in weight.', 'Bodies of baboons are covered with fur that can be dark olive or yellow in color. Males and females look alike, except that females do not have long hair around their necks.', - 'Baboons have long, dog-like muzzle and strong jaw equipped with sharp canines.', + 'Baboons have long, dog-like muzzles and strong jaws equipped with sharp canines.', 'Baboons are mainly terrestrial animals (live on the ground). They travel large distances in the early morning and late afternoon in the search for food.', 'Baboons live in groups called troops. They consist of 7-8 males, twice as many females and their offspring. Dominance in the troop is established via fights.', 'Baboons use 30 different sounds for communication. They are able to grunt, scream and bark. Besides vocalization, baboons can yawn, smack their lips or shrug their shoulder to communicate.', @@ -2302,9 +2302,9 @@ def animalfactsbot(reddit): 'Scientists believe that puffer fish developed their puffing tactic as a method of self defense because they are poor swimmers that cannot escape from danger quickly.', 'Sharks are the only species immune to the puffer fish\'s toxin. They can eat puffer fish without any negative consequences', 'Puffer fish do not have scales. Their skin is thick and rough. Some species have spines on their skin, which offer additional protection against predators.', - 'Puffer fish can be discretely or brightly colored. There is often relationship between the body coloration and the amount of toxin produced by the fish (brighter colors are often associated with large quantity of toxin in the fish).', - 'Puffer fish have four teeth that are fused in the beak-like structure. They use their teeth for opening of mussels, clams and shellfish. Puffer fish also eat algae and different types of worms and crustaceans.', - 'One puffer fish contains enough toxin to kill 30 adult men.' + 'Puffer fish can be discretely or brightly colored. There is often a relationship between the body coloration and the amount of toxin produced by the fish (brighter colors are often associated with large quantity of toxin in the fish).', + 'Puffer fish have four teeth that are fused in the beak-like structure. They use their teeth for opening of mussels, clams and shellfish. Puffer fish also eat algae and different types of worms and crustaceans.', + 'One puffer fish contains enough toxin to kill 30 adult men.', ) PORCUPINE_FACTS = ( @@ -2334,9 +2334,9 @@ def animalfactsbot(reddit): 'Quokkas do not fear humans and will approach people closely if you visit them on Rottnest Island. However, it is illegal for humans to handle or feed them.', 'Rottnest Island in Australia, where many quokkas live, was given its name when a Dutch explorer mistook the quokkas for rats. The name means "rat nest" in Dutch.', 'A baby quokka is called a joey. Females can give birth to joeys twice a year. The joey will live in the pouch of its mother for six months.', - 'The average lifespan of a Quokka is 10 years.', - 'Quokkas have sharp teeth and will shriek if cornered or attacked or if they feel threatened or provoked.', - 'The quokkas lack of fear of humans and the small size of their natural habitat makes them vulnerable to becoming endangered as a species.', + 'The average lifespan of a Quokka is 10 years.', + 'Quokkas have sharp teeth and will shriek if cornered or attacked or if they feel threatened or provoked.', + 'The quokkas lack of fear of humans and the small size of their natural habitat makes them vulnerable to becoming endangered as a species.', ) RABBIT_FACTS = ( @@ -3036,7 +3036,7 @@ def animalfactsbot(reddit): ARMADILLO_FACTS, AXOLOTL_FACTS, BADGER_FACTS, - BABOON_FACTS, + BABOON_FACTS, BEAR_FACTS, BEAVER_FACTS, BUFFALO_FACTS, From 5960bd4649098de7656fde04e9068a6aa4ac041c Mon Sep 17 00:00:00 2001 From: Mark Pentler Date: Fri, 11 Jan 2019 23:42:23 +0000 Subject: [PATCH 4/4] Update README.md Corrected animal order (Baboon) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cfc1881..dec322c 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,8 @@ You can see the bot in action at https://www.reddit.com/user/AnimalFactsBot/comm * Antelope * Armadillo * Atlantic puffin -* Badger * Baboon +* Badger * Bear * Beaver * Bison