Last active
April 28, 2016 17:40
-
-
Save davidbegin/9ecb04d7df35f009727167b8719033f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PartyParrot | |
class << self | |
def party! | |
post_to_slack do | |
"#{party_parrot_key} " * 100 | |
end | |
end | |
private | |
def post_to_slack | |
`curl -X POST --data-urlencode 'payload={"channel": "#{channel}", "username": "#{name}", "text": "#{yield}", "icon_emoji": ":#{party_parrot_key}:"}' #{url}` | |
end | |
# Rename to what your emoji key for PartyParrot is | |
def party_parrot_key | |
":ahhyeah:" | |
end | |
def name | |
"Party Parrot" | |
end | |
# Choose you channel you want to post to | |
def channel | |
"#beginland" | |
end | |
# insert you slack hook | |
def url | |
"https://hooks.slack.com/services/IDENTIFIER/ANOTHER_IDENTIFIER/ANDANOTHERIDENTIFIER" | |
end | |
end | |
end | |
PartyParrot.party! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment