Last active
July 11, 2017 13:52
-
-
Save veryhappythings/f9a7700f9fb190cc32fceec5c3636c88 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
#! /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