cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
if [[ "${cur}" == -* ]] ; then
- COMPREPLY=( $(compgen -W "-a -A -p -P -H -b -d -v -s -n -g -h
+ COMPREPLY=( $(compgen -W "-a -A -p -P -H -b -d -v -s -n -g -h -r
--account --action --password --proxy --host --bash \
--user --debug --dry-run --shrink-urls --page --version --verbose \
- --help" -- ${cur}) )
+ --help --replyto" -- ${cur}) )
fi
if [[ "${prev}" == "--host" ]] ; then
bti \- send a tweet to twitter\&.com or identi\&.ca from the command line
.SH "SYNOPSIS"
.HP \w'\fBbti\fR\ 'u
-\fBbti\fR [\fB\-\-account\ account\fR] [\fB\-\-password\ password\fR] [\fB\-\-action\ action\fR] [\fB\-\-user\ screenname\fR] [\fB\-\-host\ HOST_NAME\fR] [\fB\-\-proxy\ PROXY:PORT\fR] [\fB\-\-logfile\ LOGFILE\fR] [\fB\-\-config\ CONFIGFILE\fR] [\fB\-\-page\ PAGENUMBER\fR] [\fB\-\-bash\fR] [\fB\-\-shrink\-urls\fR] [\fB\-\-debug\fR] [\fB\-\-dry\-run\fR] [\fB\-\-verbose\fR] [\fB\-\-version\fR] [\fB\-\-help\fR]
+\fBbti\fR [\fB\-\-account\ account\fR] [\fB\-\-password\ password\fR] [\fB\-\-action\ action\fR] [\fB\-\-user\ screenname\fR] [\fB\-\-host\ HOST_NAME\fR] [\fB\-\-proxy\ PROXY:PORT\fR] [\fB\-\-logfile\ LOGFILE\fR] [\fB\-\-config\ CONFIGFILE\fR] [\fB\-\-replyto\ ID\fR] [\fB\-\-page\ PAGENUMBER\fR] [\fB\-\-bash\fR] [\fB\-\-shrink\-urls\fR] [\fB\-\-debug\fR] [\fB\-\-dry\-run\fR] [\fB\-\-verbose\fR] [\fB\-\-version\fR] [\fB\-\-help\fR]
.SH "DESCRIPTION"
.PP
bti sends a tweet message to twitter\&.com or identi\&.ca\&.
Specify a config file for bti to read from\&. By default, bti looks in the ~/\&.bti file for config values\&. This default location can be overridden by setting a specific file with this option\&.
.RE
.PP
+\fB\-\-replyto ID\fR
+.RS 4
+Status ID of a single post to which you want to create a threaded reply to\&.
+.sp
+For twitter, this is ignored unless the message starts with the @name of the owner of the post with the status ID\&.
+.sp
+For status\&.net, this can link any two messages into context with each other\&. Status\&.net will also link a message that contains an @name without this without regard to context\&.
+.RE
+.PP
\fB\-\-shrink\-urls\fR
.RS 4
Scans the tweet text for valid URL patterns and passes each through the supplied bti\-shrink\-urls script\&. The script will pass the URL to a web service that shrinks the URLs, making it more suitable for micro\-blogging\&.
char *hosturl;
char *hostname;
char *configfile;
+ char *replyto;
int bash;
int interactive;
int shrink_urls;
fprintf(stdout, " --host HOST\n");
fprintf(stdout, " --logfile logfile\n");
fprintf(stdout, " --config configfile\n");
+ fprintf(stdout, " --replyto ID\n");
fprintf(stdout, " --shrink-urls\n");
fprintf(stdout, " --page PAGENUMBER\n");
fprintf(stdout, " --bash\n");
{
if (!session)
return;
+ free(session->replyto);
free(session->password);
free(session->account);
free(session->tweet);
CURLFORM_COPYCONTENTS, "bti",
CURLFORM_END);
+ if (session->replyto)
+ curl_formadd(&formpost, &lastptr,
+ CURLFORM_COPYNAME, "in_reply_to_status_id",
+ CURLFORM_COPYCONTENTS, session->replyto,
+ CURLFORM_END);
+
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
slist = curl_slist_append(slist, "Expect:");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);
{ "page", 1, NULL, 'g' },
{ "version", 0, NULL, 'v' },
{ "config", 1, NULL, 'c' },
+ { "replyto", 1, NULL, 'r' },
{ }
};
struct session *session;
parse_configfile(session);
while (1) {
- option = getopt_long_only(argc, argv, "dp:P:H:a:A:u:c:hg:G:snVv",
+ option = getopt_long_only(argc, argv, "dp:P:H:a:A:u:c:hg:G:sr:nVv",
options, NULL);
if (option == -1)
break;
dbg("page = %d\n", page_nr);
session->page = page_nr;
break;
+ case 'r':
+ session->replyto = strdup(optarg);
+ dbg("in_reply_to_status_id = %s\n", session->replyto);
+ break;
case 'p':
if (session->password)
free(session->password);
<arg><option>--proxy PROXY:PORT</option></arg>
<arg><option>--logfile LOGFILE</option></arg>
<arg><option>--config CONFIGFILE</option></arg>
+ <arg><option>--replyto ID</option></arg>
<arg><option>--page PAGENUMBER</option></arg>
<arg><option>--bash</option></arg>
<arg><option>--shrink-urls</option></arg>
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--replyto ID</option></term>
+ <listitem>
+ <para>
+ Status ID of a single post to which you want to create a threaded
+ reply to.
+ </para>
+ <para>
+ For twitter, this is ignored unless the message starts with the
+ @name of the owner of the post with the status ID.
+ </para>
+ <para>
+ For status.net, this can link any two messages into context with
+ each other. Status.net will also link a message that contains an
+ @name without this without regard to context.
+ </para>
+ </listitem>
+ </varlistentry>
<varlistentry>
<term><option>--shrink-urls</option></term>
<listitem>