2 <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
13 <productname>bti</productname>
17 <refentrytitle>bti</refentrytitle>
18 <manvolnum>1</manvolnum>
19 <refmiscinfo class="version"></refmiscinfo>
23 <refname>bti</refname>
24 <refpurpose>send a tweet to twitter.com or identi.ca from the command line</refpurpose>
29 <command>bti</command>
30 <arg><option>--account account</option></arg>
31 <arg><option>--password password</option></arg>
32 <arg><option>--action action</option></arg>
33 <arg><option>--user screenname</option></arg>
34 <arg><option>--host HOST_NAME</option></arg>
35 <arg><option>--proxy PROXY:PORT</option></arg>
36 <arg><option>--logfile LOGFILE</option></arg>
37 <arg><option>--config CONFIGFILE</option></arg>
38 <arg><option>--replyto ID</option></arg>
39 <arg><option>--retweet ID</option></arg>
40 <arg><option>--page PAGENUMBER</option></arg>
41 <arg><option>--bash</option></arg>
42 <arg><option>--shrink-urls</option></arg>
43 <arg><option>--debug</option></arg>
44 <arg><option>--dry-run</option></arg>
45 <arg><option>--verbose</option></arg>
46 <arg><option>--version</option></arg>
47 <arg><option>--help</option></arg>
51 <refsect1><title>DESCRIPTION</title>
52 <para>bti sends a tweet message to twitter.com or identi.ca.
56 <refsect1><title>OPTIONS</title>
59 <term><option>--account account</option></term>
62 Specify the twitter.com or identi.ca account name.
67 <term><option>--password password</option></term>
70 Specify the password of your twitter.com or identi.ca account.
75 <term><option>--action action</option></term>
78 Specify the action which you want to perform. Valid options
79 are "update" to send a message, "friends" to see your friends
80 timeline, "public" to track public timeline, "replies" to see
81 replies to your messages, "user" to see a specific user's
82 timeline and "direct" to send a direct message to a friend.
88 <term><option>--user screenname</option></term>
91 Specify the user whose messages you want to see when the
92 action is "user", and the reciever of the direct message when
93 the action is "direct" (the sender must be following the
99 <term><option>--host HOST_NAME</option></term>
102 Specify the host which you want to send your message to. Valid
103 options are "twitter" to send to twitter.com and "identica" to
106 If you want to send the message to a custom StatusNet installation,
107 you should specify the API URI. For example identi.ca's URI is:
108 https://identi.ca/api/statuses
111 If no host is specified, the default is to send to twitter.com.
116 <term><option>--proxy PROXY:PORT</option></term>
119 Specify a http proxy value. This is not a required option, and
120 only needed by systems that are behind a http proxy.
123 If --proxy is not specified but the environment variable
124 'http_proxy' is set the latter will be used.
129 <term><option>--logfile LOGFILE</option></term>
132 Specify a logfile for bti to write status messages to. LOGFILE
133 is in relation to the user's home directory, not an absolute
139 <term><option>--config CONFIGFILE</option></term>
142 Specify a config file for bti to read from. By default, bti
143 looks in the ~/.bti file for config values. This default
144 location can be overridden by setting a specific file with this
150 <term><option>--replyto ID</option></term>
153 Status ID of a single post to which you want to create a threaded
157 For twitter, this is ignored unless the message starts with the
158 @name of the owner of the post with the status ID.
161 For status.net, this can link any two messages into context with
162 each other. Status.net will also link a message that contains an
163 @name without this without regard to context.
168 <term><option>--retweet ID</option></term>
171 Status ID of a single post which you want to retweet.
176 <term><option>--shrink-urls</option></term>
179 Scans the tweet text for valid URL patterns and passes each
180 through the supplied bti-shrink-urls script. The script will
181 pass the URL to a web service that shrinks the URLs, making it
182 more suitable for micro-blogging.
185 The following URL shrinking services are available:
186 http://2tu.us/ (default) and http://bit.ly / http://j.mp
189 See the documentation for bti-shrink-urls for the configuration options.
194 <term><option>--debug</option></term>
196 <para>Print a whole bunch of debugging messages to stdout.</para>
200 <term><option>--page PAGENUMBER</option></term>
203 When the action is to retrieve updates, it usually retrieves
204 only one page. If this option is used, the page number can be
210 <term><option>--dry-run</option></term>
213 Performs all steps that would normally be done for a given
214 action, but will not connect to the service to post or retrieve data.
219 <term><option>--verbose</option></term>
222 Verbose mode. Print status IDs and timestamps.
227 <term><option>--bash</option></term>
230 Add the working directory and a '$' in the tweet message to
231 help specify it is coming from a command line. Don't put the
232 working directory and the '$' in the tweet message.
236 This option implies <option>--background</option>.
241 <term><option>--background</option></term>
244 Do not report back any errors that might have
245 happened when sending the message, and send it in the
246 background, returning immediately, allowing the user
252 <term><option>--version</option></term>
254 <para>Print version number.</para>
258 <term><option>--help</option></term>
260 <para>Print help text.</para>
267 <title>DESCRIPTION</title>
269 bti provides an easy way to send tweet messages direct from the
270 command line or any script. It reads the message on standard
271 input and uses the account and password settings either from the
272 command line options, or from a config file, to send the message
276 Its primary focus is to allow you to log everything that you
277 type into a bash shell, in a crazy, "this is what I'm doing right
278 now!" type of way, letting the world follow along with you
279 constant moving between directories and refreshing your email
280 queue to see if there's anything interesting going on.
283 To hook bti up to your bash shell, export the following variable:
286 <literal> PROMPT_COMMAND='history 1 | sed -e "s/^\s*[0-9]*\s*//" | bti --bash'</literal>
289 This example assumes that you have the
290 <filename>~/.bti</filename> set up with your account and password
291 information already in it, otherwise you can specify them as an
297 <title>CONFIGURATION</title>
299 The account and password can be stored in a configuration file
300 in the users home directory in a file named
301 <filename>.bti</filename>. The structure of this file is as
306 <term><option>account</option></term>
309 The twitter.com or identi.ca account name you wish to use to send this
315 <term><option>password</option></term>
318 The twitter.com or identi.ca password for the account you wish to use
319 to send this message with.
324 <term><option>--action action</option></term>
327 Specify the action which you want to perform. Valid options
328 are "update" to send a message, "friends" to see your friends
329 timeline, "public" to track public timeline, "replies" to see
330 replies to your messages and "user" to see a specific user's
336 <term><option>--user screenname</option></term>
339 Specify the user you want to see his/her messages while the
345 <term><option>host</option></term>
348 The host you want to use to send the message to. Valid
349 options are either "twitter" or "identica" to send to
350 twitter.com or identi.ca respectively.
352 If you want to send the message to a custom StatusNet installation,
353 you should specify the API URI. For example identi.ca's URI is:
354 https://identi.ca/api/statuses.
359 <term><option>proxy</option></term>
362 The http proxy needed to send data out to the Internet.
367 <term><option>logfile</option></term>
370 The logfile name for bti to write what happened to.
371 This file is relative to the user's home directory. If this
372 file is not specified here or on the command line, no logging
373 will be written to the disk.
378 <term><option>replyto</option></term>
381 The status ID to which all notices will be linked to.
384 There is no sane reason for a need to have this set in a
385 config file. One such reason is to have all your messages
386 as children to a particular status.
391 <term><option>shrink-urls</option></term>
394 Setting this variable to 'true' or 'yes' will enable the URL
395 shrinking feature. This is equivalent to using the
396 --shrink-urls option.
401 <term><option>verbose</option></term>
404 Setting this variable to 'true' or 'yes' will enable the
411 There is an example config file in
412 <filename>/usr/share/doc/bti/examples/bti.example</filename> that shows
413 the structure of the file.
416 Configuration options have the following priority:
421 <listitem><para>command line option</para></listitem>
425 <listitem><para>config file option</para></listitem>
429 <listitem><para>environment variables</para></listitem>
433 For example, command line options always override any config file
434 option, or any environment variables. Unless a config file is
435 specified by the command line. At that point, the new config file is
436 read, and any previous options set by a command line option, would be
441 <refsect1><title>AUTHOR</title>
442 <para>Written by Greg Kroah-Hartman <<email>greg@kroah.com</email>> and Amir Mohammad Saied <<email>amirsaied@gmail.com</email>>.</para>