@@ -15,19 +15,23 @@ credentials for your app.
1515Features
1616--------
1717
18- * Python 2 and 3 support
18+ * Python 2.6, 2.7 and 3. 3 support
1919* Adapters for various http libraries like requests, aiohttp and tornado
2020* WebHook validation
2121* Signature generation for socket subscriptions
2222
2323Installation
2424------------
2525
26- The pusher-rest-python library will be availabe on PyPi:
27- ` pip install python-rest `
26+ You can install this module using your package management method or choice,
27+ normally ` easy_install ` or ` pip ` . For example:
2828
29- Configuration
30- -------------
29+ ``` bash
30+ pip install pusher-rest
31+ ```
32+
33+ Getting started
34+ ---------------
3135
3236The minimum configuration required to use the Pusher object are the three
3337constructor arguments which identify your Pusher app. You can find them by
@@ -38,20 +42,18 @@ from pusher import Config, Pusher
3842pusher = Pusher(config = Config(app_id = u ' 4' , key = u ' key' , secret = u ' secret' ))
3943```
4044
41- ### From URL
45+ You can then trigger events to channels. Channel and event names may only
46+ contain alphanumeric characters, ` - ` and ` _ ` :
4247
4348``` python
44- from pusher import Config, Pusher
45- pusher = Pusher(config = Config.from_url(u ' http://key:secret@somehost/apps/4' ))
49+ pusher.trigger(' a_channel' , ' an_event' , {' some' : ' data' })
4650```
4751
48- ### From ENV
49-
50- On Heroku the addon sets the PUSHER_URL environment variable with the url.
52+ You can also specify ` socket_id ` as a separate argument, as described in
53+ < http://pusher.com/docs/duplicates > :
5154
5255``` python
53- from pusher import Config, Pusher
54- pusher = Pusher(config = Config.from_env())
56+ pusher.trigger(' a_channel' , ' an_event' , {' some' : ' data' }, socket_id)
5557```
5658
5759### Additional options
@@ -61,13 +63,13 @@ documentation to get all the details.
6163
6264TODO: Add link to code docs here
6365
64- Test
65- ----
66+ Running the tests
67+ -----------------
6668
6769To run the tests run ` python setup.py test `
6870
6971License
7072-------
7173
72- This code is free to use under the terms of the MIT license .
74+ Copyright (c) 2014 Pusher Ltd. See LICENSE for details .
7375
0 commit comments