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