-
Client makes authenticated connection to the user stream endpoint.
Authentication in headers or query string.
Endpoint:
wss://stream-channel.app.net/stream/user
(WebSocket) orhttps://stream-channel.app.net/stream/user
(streaming HTTP).If authentication fails, etc., client will be disconnected immediately with the appropriate HTTP error code.
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
pip install ndg-httpsclient==0.3.2 pyasn1==0.1.7 pyOpenSSL==0.13.1 requests==2.2.1 | |
# with a cert.pem file in the same directory as ssl_server.py | |
python ssl_server.py | |
# in another terminal with same virtualenv | |
python ssl_client.py |
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
ten_days_prior;process_date;10 days before {birthday} | |
seven_days_prior;process_date;7 days before {birthday} | |
-- | |
Buy card for {name}'s birthday #personal ^{ten_days_prior} *every year | |
Send card for {name}'s birthday #personal ^{seven_days_prior} *every year | |
Call {name} for birthday #personal ^{birthday} *every year |
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
import mimetypes | |
import pprint | |
import requests # pip install requests | |
import simplejson as json | |
from os.path import basename, expanduser | |
base_url = 'https://alpha-api.app.net/stream/0' | |
token = 'USER ACCESS TOKEN' | |
image_path = 'PATH TO FILE' |
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
$ curl -H 'Authorization: BEARER [access token]' "https://alpha-api.app.net/stream/0/posts/stream/unified" | |
{ | |
"data": [...], | |
"meta": { | |
"code": 200, | |
"marker": { | |
"name": "unified" | |
}, | |
"max_id": 65009, | |
"min_id": 65009, |
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
$ curl https://alpha.app.net/oauth/access_token -d 'client_id=[CLIENT_ID]&client_secret=[CLIENT_SECRET]&grant_type=client_credentials' | |
{"access_token": "[APP_ACCESS_TOKEN]"} |