Command-line wrapper of Adium
Project description
Adium Shell (adium-sh) is a command-line tool and Python wrapper for Adium.
Description
adium-sh provides shell utilities and Python wrapper based on AppleScript support of Adium.
Feature
The current features are:
Set default service and account
Send messages using exact account name or alias
Receive and reply to messages using patterns or external API (SimSimi currently supported)
React to events
Installation
$ pip install adium-sh
Usage
You must specify the account and service to associate with the current use, either as command-line arguments or in the config file. When specifying them as arguments, you must put them before the sub-commands.
Send messages
Send a message using account name:
$ adiumsh -s GTalk -t yourname@gmail send -b buddy@gmail.com Hello, there <<EOF
Send a message using alias:
$ adiumsh -s GTalk -t yourname@gmail.com send -a 'John Smith' Hello, there <<EOF
Set default configuration file at ~/.adiumsh:
[default] service = GTalk account = yourname@gmail.com
Then you can send messages without specifying -s/--service and -t/--account:
$ adiumsh send -a 'John Smith'
You can also pass as argument your message:
$ adiumsh send -a 'John Smith' -m 'Hello, there'
Receive messages
You must specify a chat method to receive messages. By default, adium-sh uses “Simple Chat”, which basically replies to received messages according to the patterns you set. You must set the patterns in the config file, possibly like the following settings:
[default] service = GTalk account = yourname@gmail.com [chat-default] type = wildcard patterns = *hello*: hi *what*: sorry *: I'm not available now
Then, you can invoke the “receive” sub-command with the -c/--chat arguments:
$ adiumsh receive -c default
The patterns is a list of string pairs where each pair is separated by a colon. The string to the left of the colon is the pattern against which the received text will be matched, and the right one is the corresponding reply text. There is also a “type” option in the chat section, which defaults to “wildcard” that uses globbing pattern matching; another value to it is “regex”, which uses regular expression.
You can also use “SimSimi Chat” which hits the SimSimi API with the messages received. You have to set the API key in the config file and the key type (“trial”, which is default, or “paid”):
[chat-simi] simi-key = some-really-long-key simi-key-type = trial
Then, invoke “receive” with this chat from command line:
$ adiumsh receive -c simi
Set the default chat in the default settings:
[default] service = GTalk account = yourname@gmail.com chat = default [chat-default] patterns = *hello*: hi *what*: sorry *: I'm not available now [chat-another] patterns = *: not here
Now you can also switch between chats from the command line other than the default:
$ adiumsh receive -c another
TODO
Complete Python wrapper API to AppleScript support
Exhaustive commands based on the wrapper
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file adium-sh-0.2.4.tar.gz
.
File metadata
- Download URL: adium-sh-0.2.4.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a8a3d7a9bd9d43a2a9096d697a639116bbc1de52c3c7415029d2dd0743e2459 |
|
MD5 | ed1e6169ac360d230dbec616577bd66c |
|
BLAKE2b-256 | 8b68e06599b0198c34b91d90136ad16b12193d6cf2924abcd6577a3df7549568 |