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 blue sea slug #318

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 @@ -47,6 +47,7 @@ You can see the bot in action at https://www.reddit.com/user/AnimalFactsBot/comm
* Bear
* Beaver
* Bison
* Blue Sea Slug
* Bobcat
* Buffalo
* Camel
Expand Down
9 changes: 9 additions & 0 deletions animalfacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def check_comment_for_animal(comment, reddit):
botengine('buffalo', '\sbuffalos?\s', reddit, BUFFALO_FACTS, comment)
botengine('bobcat','\sbobcats?\s',reddit, BOBCAT_FACTS,comment)
botengine('bison', '\sbisons?\s', reddit, BISON_FACTS, comment)
botengine('blue sea slug', '\s(blue (sea slug|angel|glaucus|dragon|ocean slug))|(sea swallow)?\s', reddit, BLUE_SEA_SLUG_FACTS, comment)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joel-g I can't do regex :( is this all good? We have the two word issue #168 to think about first.

botengine('camel', '\scamels?\s', reddit, CAMEL_FACTS, comment)
botengine('capybara', '\scapybaras?\s', reddit, CAPYBARA_FACTS, comment)
botengine('chameleon', '\schameleons?\s', reddit, CHAMELEON_FACTS, comment)
Expand Down Expand Up @@ -689,6 +690,13 @@ def animalfactsbot(reddit):
'When bison are born, their fur is orange-red. After a few months, their fur steadily grows more brown.'
)

BLUE_SEA_SLUG = (
'Blue sea slugs float upside down on the surface of water using surface tension to stay afloat.'
'Blue sea slugs feed on the venomous Portuguese man o\' war.'
'Blue sea slugs are typically blue or blue-white on their undersides, which face the sky when they float on their backs, and are silver-gray on their tops, which typically face down into the water; this countershading provides protection from predators.'
'Blue sea slugs can store the stinging nematocysts from devoured prey within its own tissues, making them a dangerous threat to predators or humans who attempt to handle them.'
)

BOBCAT_FACTS = (
'An adult bobcat\'s tail averages just 6 to 7 inches in length.',
'The word bobcat a reference to their tail. In barbershop lingo, hair that’s been cut short is sometimes called “bobbed.”',
Expand Down Expand Up @@ -3022,6 +3030,7 @@ def animalfactsbot(reddit):
BEAVER_FACTS,
BUFFALO_FACTS,
BISON_FACTS,
BLUE_SEA_SLUG_FACTS,
CAMEL_FACTS,
CAPYBARA_FACTS,
CHAMELEON_FACTS,
Expand Down