Twitter integration - added $config option for source attribute when posting to Twitter

darcs-hash:20080907062118-7b5ce-b4412446bbf245b1d14a78b01ecde0f71f621185.gz
This commit is contained in:
Zach Copley 2008-09-07 02:21:18 -04:00
parent 9eca4e0874
commit 6b42c984ee
3 changed files with 7 additions and 7 deletions

View File

@ -86,3 +86,6 @@ $config['db']['database'] = 'mysql://laconica:microblog@localhost/laconica';
#optionally show non-local messages in public timeline #optionally show non-local messages in public timeline
#$config['public']['localonly'] = false; #$config['public']['localonly'] = false;
#Twitter integration source attribute. Note: default is Laconica
#$config['integration']['source'] = 'Laconica';

View File

@ -97,11 +97,7 @@ $config =
'daemon' => 'daemon' =>
array('piddir' => '/var/run', array('piddir' => '/var/run',
'user' => false, 'user' => false,
'group' => false), 'group' => false)
'memcached' =>
array('enabled' => false,
'server' => 'localhost',
'port' => 11211)
); );
$config['db'] = &PEAR::getStaticProperty('DB_DataObject','options'); $config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');

View File

@ -1104,6 +1104,7 @@ function common_broadcast_notice($notice, $remote=false) {
} }
function common_twitter_broadcast($notice, $flink) { function common_twitter_broadcast($notice, $flink) {
global $config;
$success = true; $success = true;
$fuser = $flink->getForeignUser(); $fuser = $flink->getForeignUser();
$twitter_user = $fuser->nickname; $twitter_user = $fuser->nickname;
@ -1116,13 +1117,13 @@ function common_twitter_broadcast($notice, $flink) {
CURLOPT_POST => true, CURLOPT_POST => true,
CURLOPT_POSTFIELDS => array( CURLOPT_POSTFIELDS => array(
'status' => $statustxt, 'status' => $statustxt,
'source' => 'Laconica' 'source' => $config['integration']['source']
), ),
CURLOPT_RETURNTRANSFER => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_FAILONERROR => true, CURLOPT_FAILONERROR => true,
CURLOPT_HEADER => false, CURLOPT_HEADER => false,
CURLOPT_FOLLOWLOCATION => true, CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_USERAGENT => "identi.ca", CURLOPT_USERAGENT => "Laconica",
CURLOPT_CONNECTTIMEOUT => 120, // XXX: Scary!!!! How long should this be? CURLOPT_CONNECTTIMEOUT => 120, // XXX: Scary!!!! How long should this be?
CURLOPT_TIMEOUT => 120 CURLOPT_TIMEOUT => 120
); );