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