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