Skip to content

Commit

Permalink
Added gazelle facts firstcontributions#70
Browse files Browse the repository at this point in the history
  • Loading branch information
Blasphemouse committed Oct 14, 2017
1 parent 4c15a65 commit c5fe661
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## How to contribute (Teach AnimalFactsBot a new animal):
## How to contribute (Teach AnimalFactsBot a new animal):

Check the open issues to claim a listed animal, or come up with your own. Be sure to also check currently open pull requests to make sure you don't duplicate someone else's work.

Expand Down Expand Up @@ -53,6 +53,7 @@ You can see the bot in action at https://www.reddit.com/user/AnimalFactsBot/comm
* flamingo
* fox
* frog
* gazelle
* giraffe
* grasshopper
* goat
Expand Down
15 changes: 14 additions & 1 deletion animalfacts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import re
import re
import praw
import random
import time
Expand Down Expand Up @@ -229,6 +229,7 @@ def check_comment_for_animal(comment, reddit):
botengine('flamingo', '\sflamingos?\s', reddit, FLAMINGO_FACTS, comment)
botengine('fox', '\sfox(es)?\s', reddit, FOX_FACTS, comment)
botengine('frog', '\sfrogs?\s', reddit, FROG_FACTS, comment)
botengine('gazelle', '\sgazelles?\s', reddit, GAZELLE_FACTS, comment)
botengine('giraffe', '\sgiraffes?\s', reddit, GIRAFFE_FACTS, comment)
botengine('grasshopper', '\sgrasshoppers?\s', reddit, GRASSHOPPER_FACTS,comment)
botengine('goat', '\sgoats?\s', reddit, GOAT_FACTS, comment)
Expand Down Expand Up @@ -636,6 +637,17 @@ def animalfactsbot(reddit):
"Remarkably, frogs actually use their eyes to help them swallow food. When the frog blinks, its eyeballs are pushed downwards creating a bulge in the roof of its mouth. This bulge squeezes the food inside the frog's mouth down the back of its throat."
)

GAZELLE_FACTS = (
'A gazelle can run up to 60 miles per hour.',
'Baby gazelles are called calves or fawns.',
'Depending on the species, adult gazelles range in weight from 26 pounds to 165 pounds.',
'Gazelles use a bounding leap when running called "pronking" or "stotting".',
'When pregnant, gazelles carry their young for about six months before giving birth.',
'The name "gazelle" comes from an Arabic poetic form.',
'Gazelles generally live up to 10 to 12 years.',
'To evade predators, gazelles may zigzag rather than running in a straight line.'
)

GIRAFFE_FACTS = (
'A male giraffe can weigh as much as a pick up truck! That’s about 1400 kilograms.',
'Although a giraffe’s neck is 1.5 – 1.8 meters, it contains the same number of vertebrae at a human neck.',
Expand Down Expand Up @@ -1624,6 +1636,7 @@ def animalfactsbot(reddit):
FOX_FACTS,
FROG_FACTS,
ELEPHANT_FACTS,
GAZELLE_FACTS,
GIRAFFE_FACTS,
GRASSHOPPER_FACTS,
GOAT_FACTS,
Expand Down

0 comments on commit c5fe661

Please sign in to comment.