Created
February 5, 2013 15:45
-
-
Save georgebrock/4715265 to your computer and use it in GitHub Desktop.
yampy usage example
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 yampy | |
auth = yampy.Authenticator(client_id="foo", client_secret="bar") | |
url = auth.authorization_url(redirect_uri="http://myapp.example.com/auth/callback") | |
# Once the user has authorized the app, and been redirected back: | |
code = read_the_query_parameters_somehow("code") | |
access_token = auth.fetch_access_token(code) | |
yammer = yampy.Yammer(access_token) | |
yammer.messages.all() # /messages.json | |
yammer.messages.from_my_feed() # /messages/my_feed.json | |
yammer.messages.from_top_conversations() # /messages/algo.json | |
yammer.messages.from_followed_conversations() # /messages/following.json | |
yammer.messages.sent(newer_than=12345) # /messages/sent.json?newer_than=12345 | |
yammer.messages.received() # /messages/received.json | |
yammer.messages.private() # /messages/private.json | |
bob = yammer.users.find_by_email("[email protected]") | |
for message in yammer.messages.all(): | |
print(message.body.plain) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment