From 6b42c984eef502a9e6174f1c7b5122b678b8bf4b Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sun, 7 Sep 2008 02:21:18 -0400 Subject: [PATCH] Twitter integration - added $config option for source attribute when posting to Twitter darcs-hash:20080907062118-7b5ce-b4412446bbf245b1d14a78b01ecde0f71f621185.gz --- config.php.sample | 3 +++ lib/common.php | 6 +----- lib/util.php | 5 +++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config.php.sample b/config.php.sample index 875dc8b254..900d99c410 100644 --- a/config.php.sample +++ b/config.php.sample @@ -86,3 +86,6 @@ $config['db']['database'] = 'mysql://laconica:microblog@localhost/laconica'; #optionally show non-local messages in public timeline #$config['public']['localonly'] = false; + +#Twitter integration source attribute. Note: default is Laconica +#$config['integration']['source'] = 'Laconica'; diff --git a/lib/common.php b/lib/common.php index d1bab51a64..8ea8fa0fad 100644 --- a/lib/common.php +++ b/lib/common.php @@ -97,11 +97,7 @@ $config = 'daemon' => array('piddir' => '/var/run', 'user' => false, - 'group' => false), - 'memcached' => - array('enabled' => false, - 'server' => 'localhost', - 'port' => 11211) + 'group' => false) ); $config['db'] = &PEAR::getStaticProperty('DB_DataObject','options'); diff --git a/lib/util.php b/lib/util.php index 5b6b59f805..b67782af34 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1104,6 +1104,7 @@ function common_broadcast_notice($notice, $remote=false) { } function common_twitter_broadcast($notice, $flink) { + global $config; $success = true; $fuser = $flink->getForeignUser(); $twitter_user = $fuser->nickname; @@ -1116,13 +1117,13 @@ function common_twitter_broadcast($notice, $flink) { CURLOPT_POST => true, CURLOPT_POSTFIELDS => array( 'status' => $statustxt, - 'source' => 'Laconica' + 'source' => $config['integration']['source'] ), CURLOPT_RETURNTRANSFER => true, CURLOPT_FAILONERROR => true, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => true, - // CURLOPT_USERAGENT => "identi.ca", + CURLOPT_USERAGENT => "Laconica", CURLOPT_CONNECTTIMEOUT => 120, // XXX: Scary!!!! How long should this be? CURLOPT_TIMEOUT => 120 ); -- 2.39.5