Skip to content

Instantly share code, notes, and snippets.

@veryhappythings
Last active July 11, 2017 13:52
Show Gist options
  • Save veryhappythings/f9a7700f9fb190cc32fceec5c3636c88 to your computer and use it in GitHub Desktop.
Save veryhappythings/f9a7700f9fb190cc32fceec5c3636c88 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
import json
import urllib
import requests
api_token = "PLEASE INSERT API TOKEN"
slack = "PLEASE INSERT NAME OF SLACK"
method = "users.profile.set"
params = {
"token": api_token,
"profile": {
"status_text": "Working remotely",
"status_emoji": ":house_with_garden:"
}
}
url = "https://{0}.slack.com/api/{1}?{2}".format(
slack,
method,
urllib.urlencode(params)
)
payload = requests.get(url).json()
print json.dumps(payload, indent=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment