From 09dfe32eb6b538225686fd6ed0220240010bc574 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 1 Aug 2011 01:22:36 -0400 Subject: initial commit. Partway through a rewrite. I have some old files I didn't want to entirely delete. --- src/plugins/SenderIdentica.class.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/plugins/SenderIdentica.class.php (limited to 'src/plugins/SenderIdentica.class.php') diff --git a/src/plugins/SenderIdentica.class.php b/src/plugins/SenderIdentica.class.php new file mode 100644 index 0000000..4bb20c9 --- /dev/null +++ b/src/plugins/SenderIdentica.class.php @@ -0,0 +1,36 @@ +'', + 'password'=>'', + 'length'=>140); + private $obj; + + public static function description() { + return ''; + } + + public static function configList() { + return array('username'=>'text', + 'password'=>'password', + 'length'=>'int'); + } + + public function init() { + $this->obj = new Identica($this->config['username'], + $this->config['password']); + } + + public function send($id, $subject, $body) { + global $shorturl, $messenger; + $url = $shorturl->get($messenger->id2url($id)); + $maxlen = $this->config['length']-(strlen($url)+1); + if($maxlen < strlen($subject)) { + $subject = substr($subject,0,$maxlen-3).'...'; + } + $this->obj->updateStatus($subject.' '.$url); + } +} -- cgit v1.2.3-2-g168b