File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- Stream client
2- -------------
1+ stream-python
2+ =========
33
4+ .. image:: https://secure.travis-ci.org/tbarbugli/stream-php.png?branch=master
5+ :target: http://travis-ci.org/tbarbugli/stream-php
46
57
6- ## Running tests ##
8+ stream-php is a Python client for ` Stream <https://getstream.io/> ` _ .
9+
10+ .. code-block:: python
11+
12+ # Instantiate a new client
13+ import stream
14+ client = stream.connect('YOUR_API_KEY', 'API_KEY_SECRET')
15+
16+ # Instantiate a feed object
17+ user_feed_1 = client.feed('user:1')
18+
19+ # Get activities from 5 to 10
20+ result = user_feed_1.get(limit=5, offset=5)
21+ activities = result['activities']
22+
23+ # Create a new activity
24+ activity_data = {'actor': 1, 'verb': 'tweet', 'object': 1}
25+ activity_response = user_feed_1.add_activity(activity_data)
26+
27+ # Remove an activity by its id
28+ user_feed_1.remove('12345678910')
29+
30+ # Follow another feed
31+ user_feed_1.follow('flat:42')
32+
33+ # Stop following another feed
34+ user_feed_1.unfollow('flat:42')
35+
36+
37+ Installation
38+ ------------
39+
40+ Install from Pypi
41+ ~~~~~~~~~~~~~~~~~~~~~
42+
43+ .. code-block:: bash
44+
45+ pip install stream-python
46+
47+
48+
49+ Contributing
50+ ------------
51+
52+ First, make sure you can run the test suite. Tests are run via py.test
53+
54+ ::
755
856py.test stream/tests.py
957
58+
You can’t perform that action at this time.
0 commit comments