-
Notifications
You must be signed in to change notification settings - Fork 53
Configurations
HU, Pili edited this page Jul 1, 2013
·
2 revisions
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.
-
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.
Rule of thumb:
- This page may not be always update-to-date.
- You can enter our CLI by
python -i snscli.py
and usenc = new_channel('YOUR_PLATFORM')
to create a configuration for a new channel. From this structure, you will see what fields are supported. Usenew_channel('YOUR_PLATFORM', full=True)
to see all possible fields. - You can use
add_channel(nc)
to ask SNSAPI to hold your newly configured channelnc
. After adding all your channels, usesave_config()
to save it to file (defaultconf/channel.json
). You can learn the structure ofchannel.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
:
-
No need to create this file at present.
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.