Skip to content

Instantly share code, notes, and snippets.

@brianly
Created March 4, 2013 06:21
Show Gist options
  • Save brianly/5080340 to your computer and use it in GitHub Desktop.
Save brianly/5080340 to your computer and use it in GitHub Desktop.
An example showing how to use an Access Token to return messages with YamPy
# -*- coding: utf-8 -*-
ACCESS_TOKEN = ''
import json
import yampy
def pprint(raw_json):
print json.dumps(raw_json, sort_keys=True,
indent=2, separators=(',', ': '))
def main():
# Getting ready
yammer = yampy.Yammer(access_token=ACCESS_TOKEN)
# Get all my messages
all_messages = yammer.messages.all()
# Pretty print the messages
pprint(all_messages)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment