A python library for the HootSuite REST API.
Project description
HootSweet
A python API for the HootSuite REST API.
Installation
pip install hootsweet
Usage
from hootsweet import HootSweet
client_id = "Your-HootSuite-Client-ID"
client_secret = "Your-HootSuite-Client-Secret"
redirect_uri = "http://redirect.uri/"
def handle_refresh(token):
# callback function to save token to a database or file
save_token_to_db(token)
client = HootSweet(client_id, client_secret, redirect_uri=redirect_uri, refresh_cb=handle_refresh)
# Step 1 get authorization url from HootSuite
url, state = client.authorization_url()
# Step 2 go to url above and get OAuth2 code
token = client.fetch_token(code)
# client.token now contains your authentication token
# Step 3 (optional) refresh token periodically, this automatically calls handle_refresh
token = client.refresh_token()
# retrieve data from https://platform.hootsuite.com/v1/me
me = client.get_me()
# retrieve authenticated members organizations https://platform.hootsuite.com/v1/me/organizations
organizations = client.get_me_organizations()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hootsweet-0.3.2.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for hootsweet-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adbd827844fb15ba2ac7a6e226dbfff2c8660ae84740765ceb087fb3eec52ebb |
|
MD5 | d7e7642be7d853b98609fcb78f2d3fd1 |
|
BLAKE2b-256 | ec5afe0b2030743bfa03e027e48946dde53caaaf76c48674e5419314f9247f68 |