Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add polar bear facts #384

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ You can see the bot in action at https://www.reddit.com/user/AnimalFactsBot/comm
* Pigeon
* Platypus
* Porcupine
* Polar bear
* Pufferfish
* Puma
* Praying Mantis
Expand Down
20 changes: 20 additions & 0 deletions animalfacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ def check_comment_for_animal(comment, reddit):
botengine('pig', '\spigs?\s', reddit, PIG_FACTS, comment)
botengine('pigeon', '\spigeons?\s', reddit, PIGEON_FACTS, comment)
botengine('platypus', '\splatypuse?s?\s', reddit, PLATYPUS_FACTS, comment)
botengine('polar bear', '\spolar\sbears?\s', reddit, POLAR_BEAR_FACTS, comment)
botengine('porcupine', '\sporcupines?\s', reddit, PORCUPINE_FACTS, comment)
botengine('pufferfish', '\spuffer ?fish(es)?\s', reddit, PUFFERFISH_FACTS, comment)
botengine('puma', '\spumas?\s', reddit, PUMA_FACTS, comment)
Expand Down Expand Up @@ -2530,6 +2531,24 @@ def animalfactsbot(reddit):
'The average lifespan of the puffer fish is around 10 years',
)

POLAR_BEAR_FACTS = (
'Polar bears live in the Arctic.',
'Polar bears have black skin and although their fur appears white, it is actually transparent.',
'Polar bears are the largest carnivore (meat eater) that lives on land.',
'Polar bears use sea ice as a platform to hunt seals.',
'Seals make up most of a polar bears diet.',
'Male polar bears can weigh up to 680 kg (1500 lb).',
'Female polar bears usually only weigh about half as much as males.',
'Polar bears spend most of their time at sea.',
'Scientists estimate that there are around 20000 polar bears.',
'Polar bears have 42 teeth.',
'The scientific name for the polar bear is ‘ursus maritimus’.',
'Polar bears keep warm thanks to nearly 10 cm of blubber under the skin.',
'Polar bears have an excellent sense of smell, with the ability to detect seals nearly a mile away (1.6 km).',
'Polar bears can reach speeds up to 40 kph (25 mph) on land and 10 kph (6 mph) in water.',
'The polar bear was the mascot for the 1988 Winter Olympics in Calgary, Canada.',
)

PORCUPINE_FACTS = (
'The body of the porcupine is covered with sharp spines or quills.',
'Some porcupines have up to 30,000 quills on their body.',
Expand Down Expand Up @@ -3537,6 +3556,7 @@ def animalfactsbot(reddit):
PIG_FACTS,
PIGEON_FACTS,
PLATYPUS_FACTS,
POLAR_BEAR_FACTS,
PORCUPINE_FACTS,
PUFFERFISH_FACTS,
PUMA_FACTS,
Expand Down