Skip to content

Instantly share code, notes, and snippets.

@davidbegin
Last active April 28, 2016 17:40
Show Gist options
  • Save davidbegin/9ecb04d7df35f009727167b8719033f8 to your computer and use it in GitHub Desktop.
Save davidbegin/9ecb04d7df35f009727167b8719033f8 to your computer and use it in GitHub Desktop.
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