Skip to content
HU, Pili edited this page Jul 1, 2013 · 2 revisions

SNSAPI Configuration

Note, the tutorial in snscli is self-contained and you should be able to generate workable configurations (with some defaults) through snscli. Since the inline tutorial of snscli is intended for normal users, who may not have Python experience or even programming experience, it appears tedious to people who already know how to program. As such, we walk those people through SNSAPI configurations in this page.

Files Briefing

  • channel.json: The outermost element is a json list containing information to instantiate channels. Usually, this file alone suffices for your test and most work.
  • pocket.json: Some global configs of Pocket class. This file is not really used at present. Just for future extension.
  • *.json.example: You can copy those files to corresponding *.json files and fill in necessary entries.

Fields of channel.json

Rule of thumb:

  • This page may not be always update-to-date.
  • You can enter our CLI by python -i snscli.py and use nc = new_channel('YOUR_PLATFORM') to create a configuration for a new channel. From this structure, you will see what fields are supported. Use new_channel('YOUR_PLATFORM', full=True) to see all possible fields.
  • You can use add_channel(nc) to ask SNSAPI to hold your newly configured channel nc. After adding all your channels, use save_config() to save it to file (default conf/channel.json). You can learn the structure of channel.json in this way.

More to be added, feel free to edit it.

  • channel_name:
  • auth_info:
    • request_url: "(console_output)", print the auth url to stdout and then you manually copy it to a browser; "(webbrowser)", automatically load the auth url in browser; else, it is an arbitrary command-line string, the command should conform to some convention, see "auxiliary/auth" for more info.
    • fetch_code:

Fields of pocket.json

No need to create this file at present.

Additional Pointers

Since the project is continuously evolving, example configs you see else where may be out of maintenance. If you find problem, please feel free to edit (wiki), or raise an issue (code).

  • A simple tutorial , Give you a brief show. A nice tutorial walk you through objects of SNSAPI and provide a sample code. Configuring through code or directly editing *.json are equivalent. This gives you another flavour.
  • Channel Configurations. This is the real configs Pili is using everyday (with some info. being masked). Unlike other demonstration configs which give you a minimum workable set of fields, you are very likely to see all possible fields that are useful in this page. Please see last modified time of the page to check how updated it is.
  • A Clock App. Although it is not dedicated to describe configs, it is worth to try the config in that document.
Clone this wiki locally