fix document
[rainbowstream.git] / docs / index.rst
CommitLineData
c264071c 1Rainbow Stream\r
2--------------\r
3\r
4.. image:: http://img.shields.io/pypi/dm/rainbowstream.svg?style=flat\r
5 :target: https://pypi.python.org/pypi/rainbowstream\r
6\r
7.. image:: http://img.shields.io/pypi/v/rainbowstream.svg?style=flat\r
8 :target: https://pypi.python.org/pypi/rainbowstream\r
9\r
10Terminal-based Twitter Client. Realtime tweetstream, compose, search ,\r
11favorite … and much more fun directly from terminal.\r
12\r
13This package is built on the top of `Python Twitter Tool`_ and `Twitter API`_.\r
14\r
c264071c 15Install\r
16-------\r
17\r
0dc0dd00
O
18The quick way\r
19^^^^^^^^^^^^^\r
20\r
8b076818 21You will need Python and pip (2.7.x or 3.x).\r
c264071c 22\r
23.. code:: bash\r
24\r
25 sudo pip install rainbowstream\r
8b076818 26 # Python 3 users: sudo pip3 install rainbowstream\r
b84845b9 27\r
0dc0dd00
O
28The recommended way\r
29^^^^^^^^^^^^^^^^^^^\r
b84845b9 30\r
0dc0dd00 31Use `virtualenv`_\r
c264071c 32\r
33.. code:: bash\r
34\r
b84845b9 35 virtualenv venv\r
0dc0dd00
O
36 # Python 3 users : use -p to specify your Python 3 localtion as below\r
37 # virtualenv -p /usr/bin/python3 venv\r
38 source venv/bin/activate\r
c264071c 39 pip install rainbowstream\r
40\r
0dc0dd00 41\r
c264071c 42Usage\r
43-----\r
44\r
45The stream\r
46^^^^^^^^^^\r
47\r
48Just type\r
49\r
50.. code:: bash\r
51\r
aa835f48 52 rainbowstream\r
c264071c 53\r
54and see your stream.\r
55\r
56I shipped a feature which can display **tweet's images directly on terminal**.\r
57You can try it with:\r
58\r
59.. code:: bash\r
60\r
aa835f48 61 rainbowstream -iot # Or rainbowstream --image-on-term\r
c264071c 62\r
63In the first time you will be asked for authorization of Rainbow Stream\r
64app at Twitter. Just click the “Authorize access” button and paste PIN\r
65number to the terminal, the rainbow will start.\r
66\r
67The interactive mode\r
68^^^^^^^^^^^^^^^^^^^^\r
69\r
70While your personal stream is continued, you are also ready to tweet,\r
71search, reply, retweet… directly from console. Simply type “h” and hit\r
72the Enter key to see the help.\r
73\r
74Input is in interactive mode. It means that you can use arrow key to\r
75move up and down history, tab-autocomplete or 2 tab to view available\r
76suggestion. Input history from previous run is available as well.\r
77\r
78Here is full list of supported command:\r
79\r
80**Explore Commands**\r
81\r
82- ``trend`` will show global trending topics. ``trend US`` will show\r
83 trends in United States while ``trend JP Tokyo`` will show trends in\r
84 Tokyo/Japan.\r
85\r
86- ``home`` will show your timeline. ``home 10`` will print exactly 10\r
87 tweets.\r
88\r
89- ``mentions`` will show mentions timeline. ``mentions 7`` will show 7\r
90 mention tweets.\r
91\r
92- ``whois @dtvd88`` will show profile of @dtvd88.\r
93\r
94- ``view @mdo`` will show @mdo ’s timeline. ``view @dmo 9`` will print\r
95 exactly 9 tweets.\r
96\r
97- ``s #noah`` will search the word *‘noah’*. Result will come back with\r
98 highlight.\r
99\r
100**Tweet Commands**\r
101\r
102- ``t the rainbow is god's promise to noah`` will tweet exactly *‘the\r
103 rainbow is god’s promise to noah’*.\r
104\r
105- ``rt 12`` will retweet the tweet with *[id=12]*. You can see id of\r
106 each tweet beside the time.\r
107\r
162af8aa
O
108- ``quote 12`` will quote the tweet with *[id=12]*. If no extra text is added,\r
109 the quote will be cancelled.\r
110\r
c264071c 111- ``allrt 12 20`` will list 20 newest retweets of the tweet with *[id=12]*. If the number of retweets is not specified, 5 newest retweets will be listed instead.\r
112\r
113- ``rep 12 Really`` will reply *‘Really’* to the tweet with *[id=12]*.\r
114\r
115- ``fav 12`` will favorite the tweet with *[id=12]*.\r
116\r
117- ``ufav 12`` will unfavorite tweet with *[id=12]*.\r
118\r
119- ``del 12`` will delete tweet with *[id=12]*.\r
120\r
121- ``show image 12`` will show the image in tweet with *[id=12]* in your\r
122 OS’s image viewer.\r
123\r
162af8aa
O
124- ``open 12`` will open url in tweet with *[id=12]* in your\r
125 OS’s default browser.\r
126\r
c264071c 127**Direct Messages Commands**\r
128\r
129- ``inbox`` will show inbox messages. ``inbox 7`` will show newest 7\r
130 messages.\r
131\r
132- ``sent`` will show sent messages. ``sent 7`` will show newest 7\r
133 messages.\r
134\r
135- ``mes @dtvd88 hi`` will send a ``hi`` message to @dtvd88.\r
136\r
137- ``trash 5`` will remove message with *[message\_id=5]*\r
138\r
139**Friends and followers Commands**\r
140\r
141- ``ls fl`` will list all your followers (people who are following\r
142 you).\r
143\r
144- ``ls fr`` will list all your friends (people who you are following).\r
145\r
146- ``fl @dtvd88`` will follow @dtvd88.\r
147\r
148- ``ufl @dtvd88`` will unfollow @dtvd88.\r
149\r
150- ``mute @dtvd88`` will mute @dtvd88.\r
151\r
152- ``unmute @dtvd88`` will unmute @dtvd88.\r
153\r
154- ``muting`` will list muting users.\r
155\r
156- ``block @dtvd88`` will block @dtvd88.\r
157\r
158- ``unblock @dtvd88`` will unblock @dtvd88.\r
159\r
160- ``report @dtvd88`` will report @dtvd88 as a spam account.\r
161\r
bef33491
O
162**Twitter list**\r
163\r
164- ``list`` will show all lists you are belong to.\r
165\r
166- ``list home`` will show timeline of list. You will be asked for list's name.\r
167\r
168- ``list all_mem`` will show list's all members.\r
169\r
170- ``list all_sub`` will show list's all subscribers.\r
171\r
172- ``list add`` will add specific person to a list owned by you.\r
bef33491
O
173\r
174- ``list rm`` will remove specific person from a list owned by you.\r
bef33491
O
175\r
176- ``list sub`` will subscribe you to a specific list.\r
177\r
178- ``list unsub`` will unsubscribe you from a specific list.\r
179\r
180- ``list own`` will show all list owned by you.\r
181\r
182- ``list new`` will create a new list.\r
183\r
184- ``list update`` will update a list owned by you.\r
185\r
186- ``list del`` will delete a list owned by you.\r
187\r
c264071c 188**Switching Stream Commands**\r
189\r
190- ``switch public #AKB48`` will switch current stream to public stream\r
191 and track keyword ``AKB48``\r
192\r
193- ``switch public #AKB48 -f`` will do exactly as above but will ask you\r
194 to provide 2 list:\r
195\r
196 ``Only nicks`` decide what nicks will be include only.\r
197\r
198 ``Ignore nicks``\ decide what nicks will be exclude.\r
199\r
200- ``switch public #AKB48 -d`` will apply filter to *ONLY\_LIST* and\r
201 *IGNORE\_LIST*. You can setup 2 list above at ``config.py``\r
202\r
203- ``switch mine`` will switch current stream to personal stream. ``-f``\r
204 and ``-d`` will work as well.\r
205\r
206**Smart shell**\r
207\r
208- Put anything to terminal, the app will try to eval and display result as a python interactive shell.\r
209\r
210 + ``142857*2`` or ``101**3`` like a calculator.\r
211 + Even ``cal`` will show the calendar for current month.\r
212 + Put ``order_rainbow('anything')`` or ``random_rainbow('wahahaha')`` will make more fun :)\r
213\r
214**Screening Commands**\r
215\r
2d341029
O
216- ``theme`` will list available themes.\r
217\r
b6cddcd5
O
218 + ``theme monokai`` will apply *monokai* theme immedaitely.\r
219 + ``theme current_as_default`` will remember current theme as next time default.\r
2d341029 220\r
c264071c 221- ``h`` will show the help.\r
222\r
223- ``c`` will clear the screen.\r
224\r
225- ``q`` will quit.\r
226\r
e5057f23 227Available commands are listed in `Read The Docs`_.\r
c264071c 228\r
e5057f23
O
229Theme customization\r
230^^^^^^^^^^^^^^^^^^^\r
231\r
06302419 232Rainbow Stream is shipped with some default themes.\r
e5057f23
O
233You can either change theme by ``theme`` command or create your favorite one.\r
234\r
155083ad
O
235Theme’s screenshot:\r
236\r
3681056d
O
237- Monokai\r
238\r
155083ad
O
239.. figure:: https://raw.githubusercontent.com/DTVD/rainbowstream/master/screenshot/themes/Monokai.png\r
240 :alt: monokai\r
241\r
3681056d
O
242- Solarized\r
243\r
155083ad
O
244.. figure:: https://raw.githubusercontent.com/DTVD/rainbowstream/master/screenshot/themes/Solarized.png\r
245 :alt: solarized\r
246\r
3681056d
O
247- Tomorrow Night\r
248\r
aa835f48
O
249.. figure:: https://raw.githubusercontent.com/DTVD/rainbowstream/master/screenshot/themes/TomorrowNight.png\r
250 :alt: tomorrownight\r
251\r
3681056d
O
252- Larapaste\r
253\r
aa835f48
O
254.. figure:: https://raw.githubusercontent.com/DTVD/rainbowstream/master/screenshot/themes/larapaste.png\r
255 :alt: larapaste\r
256\r
e5057f23 257For detaile information, see `theme usage and customization`_.\r
c264071c 258\r
2d341029
O
259Development\r
260-----------\r
261\r
262If you want to build a runnable version yourself, follow these simple\r
263steps\r
264\r
265- `Create your own Twitter Application`_\r
266- Get your Twitter application’s API key and secret\r
267- Fork github's repo\r
268- Create a file ``consumer.py`` in ```rainbowstream```_ folder with\r
269 following content\r
270\r
271 .. code:: python\r
272\r
273 # Consumer information\r
274 CONSUMER_KEY = 'APIKey' # Your Twitter application's API key\r
275 CONSUMER_SECRET = 'APISecret' # Your Twitter application's API secret\r
276\r
277- Use pip to install in local\r
278\r
279 .. code:: bash\r
280\r
281 # cd to directory which contains setup.py\r
282 virtualenv venv # Python3 users: use -p to specify python3\r
283 source venv/bin/activate\r
284 pip install -e .\r
285 pip list | grep rainbowstream # confirm installed version\r
286 rainbowstream # local version of rainbowstream\r
c264071c 287\r
2d341029
O
288.. _Create your own Twitter Application: https://apps.twitter.com/app/new\r
289.. _``rainbowstream``: https://github.com/DTVD/rainbowstream/tree/master/rainbowstream\r
c264071c 290.. _Python Twitter Tool: http://mike.verdone.ca/twitter/\r
291.. _Twitter API: https://dev.twitter.com/docs/api/1.1\r
e5057f23 292.. _theme usage and customization: https://github.com/DTVD/rainbowstream/blob/master/theme.md\r
0dc0dd00 293.. _virtualenv: http://docs.python-guide.org/en/latest/dev/virtualenvs/\r