1 |
<?xml version='1.0'?> |
2 |
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
3 |
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
4 |
|
5 |
<article> |
6 |
<section> |
7 |
<title>bti</title> |
8 |
<refentry> |
9 |
<refentryinfo> |
10 |
<title>bti</title> |
11 |
<date>May 2008</date> |
12 |
<productname>bti</productname> |
13 |
</refentryinfo> |
14 |
|
15 |
<refmeta> |
16 |
<refentrytitle>bti</refentrytitle> |
17 |
<manvolnum>1</manvolnum> |
18 |
<refmiscinfo class="version"></refmiscinfo> |
19 |
</refmeta> |
20 |
|
21 |
<refnamediv> |
22 |
<refname>bti</refname> |
23 |
<refpurpose>send a tweet to twitter.com or identi.ca from the command line</refpurpose> |
24 |
</refnamediv> |
25 |
|
26 |
<refsynopsisdiv> |
27 |
<cmdsynopsis> |
28 |
<command>bti</command> |
29 |
<arg><option>--account account</option></arg> |
30 |
<arg><option>--password password</option></arg> |
31 |
<arg><option>--action action</option></arg> |
32 |
<arg><option>--user screenname</option></arg> |
33 |
<arg><option>--host HOST_NAME</option></arg> |
34 |
<arg><option>--proxy PROXY:PORT</option></arg> |
35 |
<arg><option>--logfile LOGFILE</option></arg> |
36 |
<arg><option>--config CONFIGFILE</option></arg> |
37 |
<arg><option>--replyto ID</option></arg> |
38 |
<arg><option>--page PAGENUMBER</option></arg> |
39 |
<arg><option>--bash</option></arg> |
40 |
<arg><option>--shrink-urls</option></arg> |
41 |
<arg><option>--debug</option></arg> |
42 |
<arg><option>--dry-run</option></arg> |
43 |
<arg><option>--verbose</option></arg> |
44 |
<arg><option>--version</option></arg> |
45 |
<arg><option>--help</option></arg> |
46 |
</cmdsynopsis> |
47 |
</refsynopsisdiv> |
48 |
|
49 |
<refsect1><title>DESCRIPTION</title> |
50 |
<para>bti sends a tweet message to twitter.com or identi.ca. |
51 |
</para> |
52 |
</refsect1> |
53 |
|
54 |
<refsect1><title>OPTIONS</title> |
55 |
<variablelist> |
56 |
<varlistentry> |
57 |
<term><option>--account account</option></term> |
58 |
<listitem> |
59 |
<para> |
60 |
Specify the twitter.com or identi.ca account name. |
61 |
</para> |
62 |
</listitem> |
63 |
</varlistentry> |
64 |
<varlistentry> |
65 |
<term><option>--password password</option></term> |
66 |
<listitem> |
67 |
<para> |
68 |
Specify the password of your twitter.com or identi.ca account. |
69 |
</para> |
70 |
</listitem> |
71 |
</varlistentry> |
72 |
<varlistentry> |
73 |
<term><option>--action action</option></term> |
74 |
<listitem> |
75 |
<para> |
76 |
Specify the action which you want to perform. Valid options |
77 |
are "update" to send a message, "friends" to see your friends |
78 |
timeline, "public" to track public timeline, "replies" to see |
79 |
replies to your messages and "user" to see a specific user's |
80 |
timeline. Default is "update". |
81 |
</para> |
82 |
</listitem> |
83 |
</varlistentry> |
84 |
<varlistentry> |
85 |
<term><option>--user screenname</option></term> |
86 |
<listitem> |
87 |
<para> |
88 |
Specify the user whose messages you want to see when the |
89 |
action is "user". |
90 |
</para> |
91 |
</listitem> |
92 |
</varlistentry> |
93 |
<varlistentry> |
94 |
<term><option>--host HOST_NAME</option></term> |
95 |
<listitem> |
96 |
<para> |
97 |
Specify the host which you want to send your message to. Valid |
98 |
options are "twitter" to send to twitter.com and "identica" to |
99 |
send to identi.ca. |
100 |
|
101 |
If you want to send the message to a custom laconi.ca installation, |
102 |
you should specify the API URI. For example identi.ca's URI is: |
103 |
https://identi.ca/api/statuses |
104 |
</para> |
105 |
<para> |
106 |
If no host is specified, the default is to send to twitter.com. |
107 |
</para> |
108 |
</listitem> |
109 |
</varlistentry> |
110 |
<varlistentry> |
111 |
<term><option>--proxy PROXY:PORT</option></term> |
112 |
<listitem> |
113 |
<para> |
114 |
Specify a http proxy value. This is not a required option, and |
115 |
only needed by systems that are behind a http proxy. |
116 |
</para> |
117 |
<para> |
118 |
If --proxy is not specified but the environment variable |
119 |
'http_proxy' is set the latter will be used. |
120 |
</para> |
121 |
</listitem> |
122 |
</varlistentry> |
123 |
<varlistentry> |
124 |
<term><option>--logfile LOGFILE</option></term> |
125 |
<listitem> |
126 |
<para> |
127 |
Specify a logfile for bti to write status messages to. LOGFILE |
128 |
is in relation to the user's home directory, not an absolute |
129 |
path to a file. |
130 |
</para> |
131 |
</listitem> |
132 |
</varlistentry> |
133 |
<varlistentry> |
134 |
<term><option>--config CONFIGFILE</option></term> |
135 |
<listitem> |
136 |
<para> |
137 |
Specify a config file for bti to read from. By default, bti |
138 |
looks in the ~/.bti file for config values. This default |
139 |
location can be overridden by setting a specific file with this |
140 |
option. |
141 |
</para> |
142 |
</listitem> |
143 |
</varlistentry> |
144 |
<varlistentry> |
145 |
<term><option>--replyto ID</option></term> |
146 |
<listitem> |
147 |
<para> |
148 |
Status ID of a single post to which you want to create a threaded |
149 |
reply to. |
150 |
</para> |
151 |
<para> |
152 |
For twitter, this is ignored unless the message starts with the |
153 |
@name of the owner of the post with the status ID. |
154 |
</para> |
155 |
<para> |
156 |
For status.net, this can link any two messages into context with |
157 |
each other. Status.net will also link a message that contains an |
158 |
@name without this without regard to context. |
159 |
</para> |
160 |
</listitem> |
161 |
</varlistentry> |
162 |
<varlistentry> |
163 |
<term><option>--shrink-urls</option></term> |
164 |
<listitem> |
165 |
<para> |
166 |
Scans the tweet text for valid URL patterns and passes each |
167 |
through the supplied bti-shrink-urls script. The script will |
168 |
pass the URL to a web service that shrinks the URLs, making it |
169 |
more suitable for micro-blogging. |
170 |
</para> |
171 |
<para> |
172 |
Currently, only http://2tu.us/ is used as a URL shrinking service. |
173 |
</para> |
174 |
</listitem> |
175 |
</varlistentry> |
176 |
<varlistentry> |
177 |
<term><option>--debug</option></term> |
178 |
<listitem> |
179 |
<para>Print a whole bunch of debugging messages to stdout.</para> |
180 |
</listitem> |
181 |
</varlistentry> |
182 |
<varlistentry> |
183 |
<term><option>--page PAGENUMBER</option></term> |
184 |
<listitem> |
185 |
<para> |
186 |
When the action is to retrieve updates, it usually retrieves |
187 |
only one page. If this option is used, the page number can be |
188 |
specified. |
189 |
</para> |
190 |
</listitem> |
191 |
</varlistentry> |
192 |
<varlistentry> |
193 |
<term><option>--dry-run</option></term> |
194 |
<listitem> |
195 |
<para> |
196 |
Performs all steps that would normally be done for a given |
197 |
action, but will not connect to the service to post or retrieve data. |
198 |
</para> |
199 |
</listitem> |
200 |
</varlistentry> |
201 |
<varlistentry> |
202 |
<term><option>--verbose</option></term> |
203 |
<listitem> |
204 |
<para> |
205 |
Verbose mode. Print status IDs and timestamps. |
206 |
</para> |
207 |
</listitem> |
208 |
</varlistentry> |
209 |
<varlistentry> |
210 |
<term><option>--bash</option></term> |
211 |
<listitem> |
212 |
<para> |
213 |
Add the working directory and a '$' in the tweet message to |
214 |
help specify it is coming from a command line. Don't put the |
215 |
working directory and the '$' in the tweet message. |
216 |
</para> |
217 |
|
218 |
<para> |
219 |
This option implies <option>--background</option>. |
220 |
</para> |
221 |
</listitem> |
222 |
</varlistentry> |
223 |
<varlistentry> |
224 |
<term><option>--background</option></term> |
225 |
<listitem> |
226 |
<para> |
227 |
Do not report back any errors that might have |
228 |
happened when sending the message, and send it in the |
229 |
background, returning immediately, allowing the user |
230 |
to continue on. |
231 |
</para> |
232 |
</listitem> |
233 |
</varlistentry> |
234 |
<varlistentry> |
235 |
<term><option>--version</option></term> |
236 |
<listitem> |
237 |
<para>Print version number.</para> |
238 |
</listitem> |
239 |
</varlistentry> |
240 |
<varlistentry> |
241 |
<term><option>--help</option></term> |
242 |
<listitem> |
243 |
<para>Print help text.</para> |
244 |
</listitem> |
245 |
</varlistentry> |
246 |
</variablelist> |
247 |
</refsect1> |
248 |
|
249 |
<refsect1> |
250 |
<title>DESCRIPTION</title> |
251 |
<para> |
252 |
bti provides an easy way to send tweet messages direct from the |
253 |
command line or any script. It reads the message on standard |
254 |
input and uses the account and password settings either from the |
255 |
command line options, or from a config file, to send the message |
256 |
out. |
257 |
</para> |
258 |
<para> |
259 |
Its primary focus is to allow you to log everything that you |
260 |
type into a bash shell, in a crazy, "this is what I'm doing right |
261 |
now!" type of way, letting the world follow along with you |
262 |
constant moving between directories and refreshing your email |
263 |
queue to see if there's anything interesting going on. |
264 |
</para> |
265 |
<para> |
266 |
To hook bti up to your bash shell, export the following variable: |
267 |
</para> |
268 |
<para> |
269 |
<literal> PROMPT_COMMAND='history 1 | sed -e "s/^\s*[0-9]*\s*//" | bti --bash'</literal> |
270 |
</para> |
271 |
<para> |
272 |
This example assumes that you have the |
273 |
<filename>~/.bti</filename> set up with your account and password |
274 |
information already in it, otherwise you can specify them as an |
275 |
option. |
276 |
</para> |
277 |
</refsect1> |
278 |
|
279 |
<refsect1> |
280 |
<title>CONFIGURATION</title> |
281 |
<para> |
282 |
The account and password can be stored in a configuration file |
283 |
in the users home directory in a file named |
284 |
<filename>.bti</filename>. The structure of this file is as |
285 |
follows: |
286 |
</para> |
287 |
<variablelist> |
288 |
<varlistentry> |
289 |
<term><option>account</option></term> |
290 |
<listitem> |
291 |
<para> |
292 |
The twitter.com or identi.ca account name you wish to use to send this |
293 |
message with. |
294 |
</para> |
295 |
</listitem> |
296 |
</varlistentry> |
297 |
<varlistentry> |
298 |
<term><option>password</option></term> |
299 |
<listitem> |
300 |
<para> |
301 |
The twitter.com or identi.ca password for the account you wish to use |
302 |
to send this message with. |
303 |
</para> |
304 |
</listitem> |
305 |
</varlistentry> |
306 |
<varlistentry> |
307 |
<term><option>--action action</option></term> |
308 |
<listitem> |
309 |
<para> |
310 |
Specify the action which you want to perform. Valid options |
311 |
are "update" to send a message, "friends" to see your friends |
312 |
timeline, "public" to track public timeline, "replies" to see |
313 |
replies to your messages and "user" to see a specific user's |
314 |
timeline. |
315 |
</para> |
316 |
</listitem> |
317 |
</varlistentry> |
318 |
<varlistentry> |
319 |
<term><option>--user screenname</option></term> |
320 |
<listitem> |
321 |
<para> |
322 |
Specify the user you want to see his/her messages while the |
323 |
action is "user". |
324 |
</para> |
325 |
</listitem> |
326 |
</varlistentry> |
327 |
<varlistentry> |
328 |
<term><option>host</option></term> |
329 |
<listitem> |
330 |
<para> |
331 |
The host you want to use to send the message to. Valid |
332 |
options are either "twitter" or "identica" to send to |
333 |
twitter.com or identi.ca respectively. |
334 |
|
335 |
If you want to send the message to a custom laconi.ca installation, |
336 |
you should specify the API URI. For example identi.ca's URI is: |
337 |
https://identi.ca/api/statuses. |
338 |
</para> |
339 |
</listitem> |
340 |
</varlistentry> |
341 |
<varlistentry> |
342 |
<term><option>proxy</option></term> |
343 |
<listitem> |
344 |
<para> |
345 |
The http proxy needed to send data out to the Internet. |
346 |
</para> |
347 |
</listitem> |
348 |
</varlistentry> |
349 |
<varlistentry> |
350 |
<term><option>logfile</option></term> |
351 |
<listitem> |
352 |
<para> |
353 |
The logfile name for bti to write what happened to. |
354 |
This file is relative to the user's home directory. If this |
355 |
file is not specified here or on the command line, no logging |
356 |
will be written to the disk. |
357 |
</para> |
358 |
</listitem> |
359 |
</varlistentry> |
360 |
<varlistentry> |
361 |
<term><option>replyto</option></term> |
362 |
<listitem> |
363 |
<para> |
364 |
The status ID to which all notices will be linked to. |
365 |
</para> |
366 |
<para> |
367 |
There is no sane reason for a need to have this set in a |
368 |
config file. One such reason is to have all your messages |
369 |
as children to a particular status. |
370 |
</para> |
371 |
</listitem> |
372 |
</varlistentry> |
373 |
<varlistentry> |
374 |
<term><option>shrink-urls</option></term> |
375 |
<listitem> |
376 |
<para> |
377 |
Setting this variable to 'true' or 'yes' will enable the URL |
378 |
shrinking feature. This is equivalent to using the |
379 |
--shrink-urls option. |
380 |
</para> |
381 |
</listitem> |
382 |
</varlistentry> |
383 |
<varlistentry> |
384 |
<term><option>verbose</option></term> |
385 |
<listitem> |
386 |
<para> |
387 |
Setting this variable to 'true' or 'yes' will enable the |
388 |
verbose mode. |
389 |
</para> |
390 |
</listitem> |
391 |
</varlistentry> |
392 |
</variablelist> |
393 |
<para> |
394 |
There is an example config file called |
395 |
<filename>bti.example</filename> in the source tree that shows |
396 |
the structure of the file if you need an example to work off of. |
397 |
</para> |
398 |
<para> |
399 |
Configuration options have the following priority: |
400 |
</para> |
401 |
<variablelist> |
402 |
<varlistentry> |
403 |
<term></term> |
404 |
<listitem><para>command line option</para></listitem> |
405 |
</varlistentry> |
406 |
<varlistentry> |
407 |
<term></term> |
408 |
<listitem><para>config file option</para></listitem> |
409 |
</varlistentry> |
410 |
<varlistentry> |
411 |
<term></term> |
412 |
<listitem><para>environment variables</para></listitem> |
413 |
</varlistentry> |
414 |
</variablelist> |
415 |
<para> |
416 |
For example, command line options always override any config file |
417 |
option, or any environment variables. Unless a config file is |
418 |
specified by the command line. At that point, the new config file is |
419 |
read, and any previous options set by a command line option, would be |
420 |
overridden. |
421 |
</para> |
422 |
</refsect1> |
423 |
|
424 |
<refsect1><title>AUTHOR</title> |
425 |
<para>Written by Greg Kroah-Hartman <<email>greg@kroah.com</email>> and Amir Mohammad Saied <<email>amirsaied@gmail.com</email>>.</para> |
426 |
</refsect1> |
427 |
|
428 |
</refentry> |
429 |
</section> |
430 |
</article> |