summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Autocomplete/Autocomplete.js2
-rw-r--r--plugins/Autocomplete/AutocompletePlugin.php10
-rw-r--r--plugins/BlogspamNetPlugin.php20
-rw-r--r--plugins/Comet/CometPlugin.php18
-rw-r--r--plugins/FBConnect/FBCLoginGroupNav.php22
-rw-r--r--plugins/FBConnect/FBCSettingsNav.php22
-rw-r--r--plugins/FBConnect/FBC_XDReceiver.php2
-rw-r--r--plugins/FBConnect/FBConnectAuth.php10
-rw-r--r--plugins/FBConnect/FBConnectLogin.php4
-rw-r--r--plugins/FBConnect/FBConnectPlugin.css8
-rw-r--r--plugins/FBConnect/FBConnectPlugin.php20
-rw-r--r--plugins/FBConnect/FBConnectSettings.php18
-rw-r--r--plugins/FBConnect/README30
-rw-r--r--plugins/GoogleAnalyticsPlugin.php18
-rw-r--r--plugins/InfiniteScroll/InfiniteScrollPlugin.php8
-rw-r--r--plugins/InfiniteScroll/readme.txt2
-rw-r--r--plugins/LilUrl/LilUrlPlugin.php64
-rw-r--r--plugins/LinkbackPlugin.php20
-rw-r--r--plugins/Meteor/MeteorPlugin.php18
-rw-r--r--plugins/OpenID/finishaddopenid.php18
-rw-r--r--plugins/OpenID/finishopenidlogin.php8
-rw-r--r--plugins/OpenID/openid.php6
-rw-r--r--plugins/OpenID/openidlogin.php6
-rw-r--r--plugins/OpenID/openidsettings.php18
-rw-r--r--plugins/OpenID/publicxrds.php22
-rw-r--r--plugins/PiwikAnalyticsPlugin.php20
-rw-r--r--plugins/PtitUrl/PtitUrlPlugin.php62
-rw-r--r--plugins/PubSubHubBub/PubSubHubBubPlugin.php122
-rw-r--r--plugins/PubSubHubBub/publisher.php86
-rw-r--r--plugins/Realtime/RealtimePlugin.php18
-rw-r--r--plugins/SimpleUrl/SimpleUrlPlugin.php79
-rw-r--r--plugins/TemplatePlugin.php23
-rw-r--r--plugins/TightUrl/TightUrlPlugin.php62
-rwxr-xr-xplugins/TwitterBridge/daemons/synctwitterfriends.php27
-rwxr-xr-xplugins/TwitterBridge/daemons/twitterqueuehandler.php4
-rwxr-xr-xplugins/TwitterBridge/daemons/twitterstatusfetcher.php37
-rw-r--r--plugins/TwitterBridge/twitter.php147
-rw-r--r--plugins/TwitterBridge/twitterauthorization.php22
-rw-r--r--plugins/TwitterBridge/twitteroauthclient.php35
-rw-r--r--plugins/TwitterBridge/twittersettings.php22
-rw-r--r--plugins/WikiHashtagsPlugin.php20
-rw-r--r--plugins/recaptcha/README2
-rw-r--r--plugins/recaptcha/recaptcha.php8
43 files changed, 872 insertions, 318 deletions
diff --git a/plugins/Autocomplete/Autocomplete.js b/plugins/Autocomplete/Autocomplete.js
index e799c11e5..dfadea004 100644
--- a/plugins/Autocomplete/Autocomplete.js
+++ b/plugins/Autocomplete/Autocomplete.js
@@ -17,7 +17,7 @@ $(document).ready(function(){
});
}
);
- $.getJSON($('address .url')[0].href+'/api/laconica/groups/list.json?user_id=' + current_user['id'] + '&callback=?',
+ $.getJSON($('address .url')[0].href+'/api/statusnet/groups/list.json?user_id=' + current_user['id'] + '&callback=?',
function(groups){
$('#notice_data-text').autocomplete(groups, {
multiple: true,
diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php
index 58b6a84ca..b75397270 100644
--- a/plugins/Autocomplete/AutocompletePlugin.php
+++ b/plugins/Autocomplete/AutocompletePlugin.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to enable nickname completion in the enter status box
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
+ * @package StatusNet
* @author Craig Andrews <candrews@integralblue.com>
* @copyright 2009 Craig Andrews http://candrews.integralblue.com
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -52,7 +52,7 @@ EOT;
}
}
- function onEndShowLaconicaStyles($action)
+ function onEndShowStatusNetStyles($action)
{
if (common_logged_in()) {
$action->cssLink('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.css');
diff --git a/plugins/BlogspamNetPlugin.php b/plugins/BlogspamNetPlugin.php
index d9372bcd5..c14569746 100644
--- a/plugins/BlogspamNetPlugin.php
+++ b/plugins/BlogspamNetPlugin.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to check submitted notices with blogspam.net
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET')) {
exit(1);
}
@@ -45,10 +45,10 @@ define('BLOGSPAMNETPLUGIN_VERSION', '0.1');
* hits, but it's better than nothing.
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*
* @see Event
*/
@@ -139,6 +139,6 @@ class BlogspamNetPlugin extends Plugin
function userAgent()
{
- return 'BlogspamNetPlugin/'.BLOGSPAMNETPLUGIN_VERSION . ' Laconica/' . LACONICA_VERSION;
+ return 'BlogspamNetPlugin/'.BLOGSPAMNETPLUGIN_VERSION . ' StatusNet/' . STATUSNET_VERSION;
}
}
diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php
index 1735d2b15..300d1e9a2 100644
--- a/plugins/Comet/CometPlugin.php
+++ b/plugins/Comet/CometPlugin.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to do "real time" updates using Comet/Bayeux
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -37,10 +37,10 @@ require_once INSTALLDIR.'/plugins/Realtime/RealtimePlugin.php';
* Plugin to do realtime updates using Comet
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
class CometPlugin extends RealtimePlugin
diff --git a/plugins/FBConnect/FBCLoginGroupNav.php b/plugins/FBConnect/FBCLoginGroupNav.php
index 6eb09c3c0..6e12c2040 100644
--- a/plugins/FBConnect/FBCLoginGroupNav.php
+++ b/plugins/FBConnect/FBCLoginGroupNav.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Menu for login group of actions
*
@@ -20,15 +20,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Menu
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @author Zach Copley <zach@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @author Zach Copley <zach@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -38,11 +38,11 @@ require_once INSTALLDIR . '/lib/widget.php';
* Menu for login group of actions
*
* @category Output
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @author Zach Copley <zach@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @author Zach Copley <zach@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*
* @see Widget
*/
diff --git a/plugins/FBConnect/FBCSettingsNav.php b/plugins/FBConnect/FBCSettingsNav.php
index 8b8411853..29724d6bd 100644
--- a/plugins/FBConnect/FBCSettingsNav.php
+++ b/plugins/FBConnect/FBCSettingsNav.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Menu for login group of actions
*
@@ -20,15 +20,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Menu
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @author Zach Copley <zach@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @author Zach Copley <zach@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -38,11 +38,11 @@ require_once INSTALLDIR . '/lib/widget.php';
* A widget for showing the connect group local nav menu
*
* @category Output
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @author Zach Copley <zach@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @author Zach Copley <zach@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*
* @see Widget
*/
diff --git a/plugins/FBConnect/FBC_XDReceiver.php b/plugins/FBConnect/FBC_XDReceiver.php
index 19251cca4..2bc790d5a 100644
--- a/plugins/FBConnect/FBC_XDReceiver.php
+++ b/plugins/FBConnect/FBC_XDReceiver.php
@@ -1,6 +1,6 @@
<?php
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
diff --git a/plugins/FBConnect/FBConnectAuth.php b/plugins/FBConnect/FBConnectAuth.php
index 6191d9ea6..647d5def8 100644
--- a/plugins/FBConnect/FBConnectAuth.php
+++ b/plugins/FBConnect/FBConnectAuth.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to enable Facebook Connect
*
@@ -20,11 +20,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
- * @author Zach Copley <zach@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
require_once INSTALLDIR . '/plugins/FBConnect/FBConnectPlugin.php';
diff --git a/plugins/FBConnect/FBConnectLogin.php b/plugins/FBConnect/FBConnectLogin.php
index 205086cd8..5696d8848 100644
--- a/plugins/FBConnect/FBConnectLogin.php
+++ b/plugins/FBConnect/FBConnectLogin.php
@@ -1,6 +1,6 @@
<?php
/*
- * Laconica - a distributed open-source microblogging tool
+ * StatusNet - a distributed open-source microblogging tool
* Copyright (C) 2008, Controlez-Vous, Inc.
*
* This program is free software: you can redistribute it and/or modify
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
diff --git a/plugins/FBConnect/FBConnectPlugin.css b/plugins/FBConnect/FBConnectPlugin.css
index e52675459..49217bf13 100644
--- a/plugins/FBConnect/FBConnectPlugin.css
+++ b/plugins/FBConnect/FBConnectPlugin.css
@@ -1,10 +1,10 @@
/** Styles for Facebook logo and Facebook user profile avatar.
*
- * @package Laconica
- * @author Sarven Capadisli <csarven@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Sarven Capadisli <csarven@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
#site_nav_global_primary #nav_fb {
diff --git a/plugins/FBConnect/FBConnectPlugin.php b/plugins/FBConnect/FBConnectPlugin.php
index c1bd1c094..593b49b4e 100644
--- a/plugins/FBConnect/FBConnectPlugin.php
+++ b/plugins/FBConnect/FBConnectPlugin.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to enable Facebook Connect
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
- * @author Zach Copley <zach@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -45,10 +45,10 @@ require_once INSTALLDIR . '/plugins/FBConnect/FBC_XDReceiver.php';
* Plugin to enable Facebook Connect
*
* @category Plugin
- * @package Laconica
- * @author Zach Copley <zach@controlyourself.ca>
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
class FBConnectPlugin extends Plugin
@@ -148,7 +148,7 @@ class FBConnectPlugin extends Plugin
}
}
- function onEndShowLaconicaStyles($action)
+ function onEndShowStatusNetStyles($action)
{
if ($this->reqFbScripts($action)) {
diff --git a/plugins/FBConnect/FBConnectSettings.php b/plugins/FBConnect/FBConnectSettings.php
index d1bea0854..911c56787 100644
--- a/plugins/FBConnect/FBConnectSettings.php
+++ b/plugins/FBConnect/FBConnectSettings.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Facebook Connect settings
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Settings
- * @package Laconica
- * @author Zach Copley <zach@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -37,10 +37,10 @@ require_once INSTALLDIR.'/lib/connectsettingsaction.php';
* Facebook Connect settings action
*
* @category Settings
- * @package Laconica
- * @author Zach Copley <zach@controlyourself.ca>
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
class FBConnectSettingsAction extends ConnectSettingsAction
diff --git a/plugins/FBConnect/README b/plugins/FBConnect/README
index 11e5ce453..77d57eff9 100644
--- a/plugins/FBConnect/README
+++ b/plugins/FBConnect/README
@@ -1,18 +1,18 @@
-This plugin allows you to utilize Facebook Connect with Laconica.
+This plugin allows you to utilize Facebook Connect with StatusNet.
Supported Facebook Connect features:
- Authenticate (register/login/logout -- works similar to OpenID)
-- Associate an existing Laconica account with a Facebook account
-- Disconnect a Facebook account from a Laconica account
+- Associate an existing StatusNet account with a Facebook account
+- Disconnect a Facebook account from a StatusNet account
Future planned functionality:
-- Invite Facebook friends to use your Laconica installation
-- Auto-subscribe Facebook friends already using Laconica
-- Share Laconica favorite notices to your Facebook stream
+- Invite Facebook friends to use your StatusNet installation
+- Auto-subscribe Facebook friends already using StatusNet
+- Share StatusNet favorite notices to your Facebook stream
To use the plugin you will need to configure a Facebook application
-to point to your Laconica installation (see the Installation section
+to point to your StatusNet installation (see the Installation section
below).
Installation
@@ -26,16 +26,16 @@ Facebook developer wiki:
http://wiki.developers.facebook.com/index.php/Connect/Setting_Up_Your_Site
-If you already are using the build-in Laconica Facebook application,
+If you already are using the build-in StatusNet Facebook application,
you can modify your existing application's configuration using the
Facebook Developer Application on Facebook. Use it to edit your
application settings, and under the 'Connect' tab, change the 'Connect
-URL' to be the main URL for your Laconica site. E.g.:
+URL' to be the main URL for your StatusNet site. E.g.:
- http://SITE/PATH_TO_LACONICA/
+ http://SITE/PATH_TO_STATUSNET/
After you application is created and configured, you'll need to add its
-API key and secret to your Laconica config.php file:
+API key and secret to your StatusNet config.php file:
$config['facebook']['apikey'] = 'APIKEY';
$config['facebook']['secret'] = 'SECRET';
@@ -47,11 +47,11 @@ config.php:
To try out the plugin, fire up your browser and connect to:
- http://SITE/PATH_TO_LACONICA/main/facebooklogin
+ http://SITE/PATH_TO_STATUSNET/main/facebooklogin
or, if you do not have fancy URLs turned on:
- http://SITE/PATH_TO_LACONICA/index.php/main/facebooklogin
+ http://SITE/PATH_TO_STATUSNET/index.php/main/facebooklogin
You should see a page with a blue button that says: "Connect with
Facebook".
@@ -62,10 +62,10 @@ Connect/Disconnect existing account
If the Facebook Connect plugin is enabled, there will be a new Facebook
Connect Settings tab under each user's Connect menu. Users can connect
and disconnect to their Facebook accounts from it. Note: Before a user
-can disconnect from Facebook, she must set a normal Laconica password.
+can disconnect from Facebook, she must set a normal StatusNet password.
Otherwise, she might not be able to login in to her account in the
future. This is usually only required for users who have used Facebook
-Connect to register their Laconica account, and therefore haven't
+Connect to register their StatusNet account, and therefore haven't
already set a local password.
Helpful links
diff --git a/plugins/GoogleAnalyticsPlugin.php b/plugins/GoogleAnalyticsPlugin.php
index 1ecbb664e..7f3d209ee 100644
--- a/plugins/GoogleAnalyticsPlugin.php
+++ b/plugins/GoogleAnalyticsPlugin.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to use Google Analytics
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2008 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET')) {
exit(1);
}
@@ -40,10 +40,10 @@ if (!defined('LACONICA')) {
* Piwik (http://www.piwik.org/) instead!
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*
* @see Event
*/
diff --git a/plugins/InfiniteScroll/InfiniteScrollPlugin.php b/plugins/InfiniteScroll/InfiniteScrollPlugin.php
index 1e4a03e4f..c955298cb 100644
--- a/plugins/InfiniteScroll/InfiniteScrollPlugin.php
+++ b/plugins/InfiniteScroll/InfiniteScrollPlugin.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to enable Infinite Scrolling
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
+ * @package StatusNet
* @author Craig Andrews <candrews@integralblue.com>
* @copyright 2009 Craig Andrews http://candrews.integralblue.com
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
diff --git a/plugins/InfiniteScroll/readme.txt b/plugins/InfiniteScroll/readme.txt
index 3ce3b7fd2..2428cc69a 100644
--- a/plugins/InfiniteScroll/readme.txt
+++ b/plugins/InfiniteScroll/readme.txt
@@ -1,4 +1,4 @@
-Infinite Scroll adds the following functionality to your Laconica installation: When a user scrolls towards the bottom of the page, the next page of notices is automatically retrieved and appended. This means they never need to click "Next Page", which dramatically increases stickiness.
+Infinite Scroll adds the following functionality to your StatusNet installation: When a user scrolls towards the bottom of the page, the next page of notices is automatically retrieved and appended. This means they never need to click "Next Page", which dramatically increases stickiness.
Installation
============
diff --git a/plugins/LilUrl/LilUrlPlugin.php b/plugins/LilUrl/LilUrlPlugin.php
new file mode 100644
index 000000000..7665b6c1e
--- /dev/null
+++ b/plugins/LilUrl/LilUrlPlugin.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Plugin to push RSS/Atom updates to a PubSubHubBub hub
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Plugin
+ * @package StatusNet
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @copyright 2009 Craig Andrews http://candrews.integralblue.com
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ exit(1);
+}
+
+require_once(INSTALLDIR.'/lib/Shorturl_api.php');
+
+class LilUrlPlugin extends Plugin
+{
+ function __construct()
+ {
+ parent::__construct();
+ }
+
+ function onInitializePlugin(){
+ $this->registerUrlShortener(
+ 'ur1.ca',
+ array('freeService'=>true),
+ array('LilUrl',array('http://ur1.ca/'))
+ );
+ }
+}
+
+class LilUrl extends ShortUrlApi
+{
+ protected function shorten_imp($url) {
+ $data['longurl'] = $url;
+ $response = $this->http_post($data);
+ if (!$response) return $url;
+ $y = @simplexml_load_string($response);
+ if (!isset($y->body)) return $url;
+ $x = $y->body->p[0]->a->attributes();
+ if (isset($x['href'])) return $x['href'];
+ return $url;
+ }
+}
diff --git a/plugins/LinkbackPlugin.php b/plugins/LinkbackPlugin.php
index 93a0294c4..c49f70de0 100644
--- a/plugins/LinkbackPlugin.php
+++ b/plugins/LinkbackPlugin.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to do linkbacks for notices containing links
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET')) {
exit(1);
}
@@ -42,10 +42,10 @@ define('LINKBACKPLUGIN_VERSION', '0.1');
* are URLs, we test each URL to see if it supports any
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*
* @see Event
*/
@@ -225,6 +225,6 @@ class LinkbackPlugin extends Plugin
function userAgent()
{
return 'LinkbackPlugin/'.LINKBACKPLUGIN_VERSION .
- ' Laconica/' . LACONICA_VERSION;
+ ' StatusNet/' . STATUSNET_VERSION;
}
}
diff --git a/plugins/Meteor/MeteorPlugin.php b/plugins/Meteor/MeteorPlugin.php
index d54d565bd..5b345d7c2 100644
--- a/plugins/Meteor/MeteorPlugin.php
+++ b/plugins/Meteor/MeteorPlugin.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to do "real time" updates using Comet/Bayeux
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -37,10 +37,10 @@ require_once INSTALLDIR.'/plugins/Realtime/RealtimePlugin.php';
* Plugin to do realtime updates using Meteor
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
class MeteorPlugin extends RealtimePlugin
diff --git a/plugins/OpenID/finishaddopenid.php b/plugins/OpenID/finishaddopenid.php
index 7753158d5..6e889205d 100644
--- a/plugins/OpenID/finishaddopenid.php
+++ b/plugins/OpenID/finishaddopenid.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Complete adding an OpenID
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Settings
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008-2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2008-2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -39,10 +39,10 @@ require_once INSTALLDIR.'/plugins/OpenID/openid.php';
* Handle the return from an OpenID verification
*
* @category Settings
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
class FinishaddopenidAction extends Action
diff --git a/plugins/OpenID/finishopenidlogin.php b/plugins/OpenID/finishopenidlogin.php
index bc0d2d66c..50a9c15c8 100644
--- a/plugins/OpenID/finishopenidlogin.php
+++ b/plugins/OpenID/finishopenidlogin.php
@@ -1,7 +1,7 @@
<?php
/*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-if (!defined('LACONICA')) { exit(1); }
+if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
require_once INSTALLDIR.'/plugins/OpenID/openid.php';
@@ -410,7 +410,7 @@ class FinishopenidloginAction extends Action
}
}
- # We try to use an OpenID URL as a legal Laconica user name in this order
+ # We try to use an OpenID URL as a legal StatusNet user name in this order
# 1. Plain hostname, like http://evanp.myopenid.com/
# 2. One element in path, like http://profile.typekey.com/EvanProdromou/
# or http://getopenid.com/evanprodromou
diff --git a/plugins/OpenID/openid.php b/plugins/OpenID/openid.php
index 4787cd605..0944117c0 100644
--- a/plugins/OpenID/openid.php
+++ b/plugins/OpenID/openid.php
@@ -1,7 +1,7 @@
<?php
/*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-if (!defined('LACONICA')) { exit(1); }
+if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/plugins/OpenID/User_openid.php');
diff --git a/plugins/OpenID/openidlogin.php b/plugins/OpenID/openidlogin.php
index 3d968c56e..07c82db3e 100644
--- a/plugins/OpenID/openidlogin.php
+++ b/plugins/OpenID/openidlogin.php
@@ -1,7 +1,7 @@
<?php
/*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-if (!defined('LACONICA')) { exit(1); }
+if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
require_once INSTALLDIR.'/plugins/OpenID/openid.php';
diff --git a/plugins/OpenID/openidsettings.php b/plugins/OpenID/openidsettings.php
index 26bf64836..104ea8d88 100644
--- a/plugins/OpenID/openidsettings.php
+++ b/plugins/OpenID/openidsettings.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Settings for OpenID
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Settings
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008-2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2008-2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -40,10 +40,10 @@ require_once INSTALLDIR.'/plugins/OpenID/openid.php';
* Lets users add, edit and delete OpenIDs from their account
*
* @category Settings
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
class OpenidsettingsAction extends AccountSettingsAction
diff --git a/plugins/OpenID/publicxrds.php b/plugins/OpenID/publicxrds.php
index f088c25d1..1b2b359ca 100644
--- a/plugins/OpenID/publicxrds.php
+++ b/plugins/OpenID/publicxrds.php
@@ -6,14 +6,14 @@
* PHP version 5
*
* @category Action
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @author Robin Millette <millette@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @author Robin Millette <millette@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://laconi.ca/
+ * @link http://status.net/
*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -29,7 +29,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -39,11 +39,11 @@ require_once INSTALLDIR.'/plugins/OpenID/openid.php';
* Public XRDS for OpenID
*
* @category Action
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @author Robin Millette <millette@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @author Robin Millette <millette@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://laconi.ca/
+ * @link http://status.net/
*
* @todo factor out similarities with XrdsAction
*/
diff --git a/plugins/PiwikAnalyticsPlugin.php b/plugins/PiwikAnalyticsPlugin.php
index dc3c7c37f..85a24c132 100644
--- a/plugins/PiwikAnalyticsPlugin.php
+++ b/plugins/PiwikAnalyticsPlugin.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to use Piwik Analytics
*
@@ -20,15 +20,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @author Tobias Diekershoff <tobias.diekershoff@gmx.net>
- * @copyright 2008 Control Yourself, Inc.
+ * @copyright 2008 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET')) {
exit(1);
}
@@ -45,13 +45,13 @@ if (!defined('LACONICA')) {
*
* exchange example.com/piwik/ with the url to your piwik installation and
* make sure you don't forget the final /
- * exchange id with the ID your laconica installation has in your Piwik analytics
+ * exchange id with the ID your statusnet installation has in your Piwik analytics
*
* @category Plugin
- * @package Laconica
+ * @package StatusNet
* @author Tobias Diekershoff <tobias.diekershoff@gmx.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*
* @see Event
*/
@@ -60,7 +60,7 @@ class PiwikAnalyticsPlugin extends Plugin
{
/** the base of your Piwik installation */
var $piwikroot = null;
- /** the Piwik Id of your laconica installation */
+ /** the Piwik Id of your statusnet installation */
var $piwikId = null;
/**
diff --git a/plugins/PtitUrl/PtitUrlPlugin.php b/plugins/PtitUrl/PtitUrlPlugin.php
new file mode 100644
index 000000000..f00d3e2f2
--- /dev/null
+++ b/plugins/PtitUrl/PtitUrlPlugin.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Plugin to push RSS/Atom updates to a PubSubHubBub hub
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Plugin
+ * @package StatusNet
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @copyright 2009 Craig Andrews http://candrews.integralblue.com
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ exit(1);
+}
+
+class PtitUrlPlugin extends Plugin
+{
+ function __construct()
+ {
+ parent::__construct();
+ }
+
+ function onInitializePlugin(){
+ $this->registerUrlShortener(
+ 'ptiturl.com',
+ array(),
+ array('PtitUrl',array('http://ptiturl.com/?creer=oui&action=Reduire&url='))
+ );
+ }
+}
+
+class PtitUrl extends ShortUrlApi
+{
+ protected function shorten_imp($url) {
+ $response = $this->http_get($url);
+ if (!$response) return $url;
+ $response = $this->tidy($response);
+ $y = @simplexml_load_string($response);
+ if (!isset($y->body)) return $url;
+ $xml = $y->body->center->table->tr->td->pre->a->attributes();
+ if (isset($xml['href'])) return $xml['href'];
+ return $url;
+ }
+}
diff --git a/plugins/PubSubHubBub/PubSubHubBubPlugin.php b/plugins/PubSubHubBub/PubSubHubBubPlugin.php
new file mode 100644
index 000000000..013a234d7
--- /dev/null
+++ b/plugins/PubSubHubBub/PubSubHubBubPlugin.php
@@ -0,0 +1,122 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Plugin to push RSS/Atom updates to a PubSubHubBub hub
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Plugin
+ * @package StatusNet
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @copyright 2009 Craig Andrews http://candrews.integralblue.com
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ exit(1);
+}
+
+define('DEFAULT_HUB','http://2pubsubhubbub.appspot.com');
+
+require_once(INSTALLDIR.'/plugins/PubSubHubBub/publisher.php');
+
+class PubSubHubBubPlugin extends Plugin
+{
+ private $hub;
+
+ function __construct()
+ {
+ parent::__construct();
+ }
+
+ function onInitializePlugin(){
+ $this->hub = common_config('PubSubHubBub', 'hub');
+ if(empty($this->hub)){
+ $this->hub = DEFAULT_HUB;
+ }
+ }
+
+ function onStartApiAtom($action){
+ $action->element('link',array('rel'=>'hub','href'=>$this->hub),null);
+ }
+
+ function onStartApiRss($action){
+ $action->element('atom:link',array('rel'=>'hub','href'=>$this->hub),null);
+ }
+
+ function onEndNoticeSave($notice){
+ $publisher = new Publisher($this->hub);
+
+ $feeds = array();
+
+ //public timeline feeds
+ $feeds[]=common_local_url('api',array('apiaction' => 'statuses','method' => 'public_timeline.rss'));
+ $feeds[]=common_local_url('api',array('apiaction' => 'statuses','method' => 'public_timeline.atom'));
+
+ //author's own feeds
+ $user = User::staticGet('id',$notice->profile_id);
+ $feeds[]=common_local_url('api',array('apiaction' => 'statuses','method' => 'user_timeline','argument' => $user->nickname.'.rss'));
+ $feeds[]=common_local_url('api',array('apiaction' => 'statuses','method' => 'user_timeline','argument' => $user->nickname.'.atom'));
+
+ //tag feeds
+ $tag = new Notice_tag();
+ $tag->notice_id = $notice->id;
+ if ($tag->find()) {
+ while ($tag->fetch()) {
+ $feeds[]=common_local_url('api',array('apiaction' => 'tags','method' => 'timeline', 'argument'=>$tag->tag.'.atom'));
+ $feeds[]=common_local_url('api',array('apiaction' => 'tags','method' => 'timeline', 'argument'=>$tag->tag.'.rss'));
+ }
+ }
+
+ //group feeds
+ $group_inbox = new Group_inbox();
+ $group_inbox->notice_id = $notice->id;
+ if ($group_inbox->find()) {
+ while ($group_inbox->fetch()) {
+ $group = User_group::staticGet('id',$group_inbox->group_id);
+ $feeds[]=common_local_url('api',array('apiaction' => 'groups','method' => 'timeline','argument' => $group->nickname.'.rss'));
+ $feeds[]=common_local_url('api',array('apiaction' => 'groups','method' => 'timeline','argument' => $group->nickname.'.atom'));
+ }
+ }
+
+ //feed of each user that subscribes to the notice's author
+ $notice_inbox = new Notice_inbox();
+ $notice_inbox->notice_id = $notice->id;
+ if ($notice_inbox->find()) {
+ while ($notice_inbox->fetch()) {
+ $user = User::staticGet('id',$notice_inbox->user_id);
+ $feeds[]=common_local_url('api',array('apiaction' => 'statuses','method' => 'user_timeline','argument' => $user->nickname.'.rss'));
+ $feeds[]=common_local_url('api',array('apiaction' => 'statuses','method' => 'user_timeline','argument' => $user->nickname.'.atom'));
+ }
+ }
+
+ /* TODO: when the reply page gets RSS and ATOM feeds, implement this
+ //feed of user replied to
+ if($notice->reply_to){
+ $user = User::staticGet('id',$notice->reply_to);
+ $feeds[]=common_local_url('api',array('apiaction' => 'statuses','method' => 'user_timeline','argument' => $user->nickname.'.rss'));
+ $feeds[]=common_local_url('api',array('apiaction' => 'statuses','method' => 'user_timeline','argument' => $user->nickname.'.atom'));
+ }*/
+
+ foreach(array_unique($feeds) as $feed){
+ if(! $publisher->publish_update($feed)){
+ common_log_line(LOG_WARNING,$feed.' was not published to hub at '.$this->hub.':'.$publisher->last_response());
+ }
+ }
+ }
+}
diff --git a/plugins/PubSubHubBub/publisher.php b/plugins/PubSubHubBub/publisher.php
new file mode 100644
index 000000000..f176a9b8a
--- /dev/null
+++ b/plugins/PubSubHubBub/publisher.php
@@ -0,0 +1,86 @@
+<?php
+
+// a PHP client library for pubsubhubbub
+// as defined at http://code.google.com/p/pubsubhubbub/
+// written by Josh Fraser | joshfraser.com | josh@eventvue.com
+// Released under Apache License 2.0
+
+class Publisher {
+
+ protected $hub_url;
+ protected $last_response;
+
+ // create a new Publisher
+ public function __construct($hub_url) {
+
+ if (!isset($hub_url))
+ throw new Exception('Please specify a hub url');
+
+ if (!preg_match("|^https?://|i",$hub_url))
+ throw new Exception('The specified hub url does not appear to be valid: '.$hub_url);
+
+ $this->hub_url = $hub_url;
+ }
+
+ // accepts either a single url or an array of urls
+ public function publish_update($topic_urls, $http_function = false) {
+ if (!isset($topic_urls))
+ throw new Exception('Please specify a topic url');
+
+ // check that we're working with an array
+ if (!is_array($topic_urls)) {
+ $topic_urls = array($topic_urls);
+ }
+
+ // set the mode to publish
+ $post_string = "hub.mode=publish";
+ // loop through each topic url
+ foreach ($topic_urls as $topic_url) {
+
+ // lightweight check that we're actually working w/ a valid url
+ if (!preg_match("|^https?://|i",$topic_url))
+ throw new Exception('The specified topic url does not appear to be valid: '.$topic_url);
+
+ // append the topic url parameters
+ $post_string .= "&hub.url=".urlencode($topic_url);
+ }
+
+ // make the http post request and return true/false
+ // easy to over-write to use your own http function
+ if ($http_function)
+ return $http_function($this->hub_url,$post_string);
+ else
+ return $this->http_post($this->hub_url,$post_string);
+ }
+
+ // returns any error message from the latest request
+ public function last_response() {
+ return $this->last_response;
+ }
+
+ // default http function that uses curl to post to the hub endpoint
+ private function http_post($url, $post_string) {
+
+ // add any additional curl options here
+ $options = array(CURLOPT_URL => $url,
+ CURLOPT_POST => true,
+ CURLOPT_POSTFIELDS => $post_string,
+ CURLOPT_USERAGENT => "PubSubHubbub-Publisher-PHP/1.0");
+
+ $ch = curl_init();
+ curl_setopt_array($ch, $options);
+
+ $response = curl_exec($ch);
+ $this->last_response = $response;
+ $info = curl_getinfo($ch);
+
+ curl_close($ch);
+
+ // all good
+ if ($info['http_code'] == 204)
+ return true;
+ return false;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php
index 75bb8a91e..82eca3d08 100644
--- a/plugins/Realtime/RealtimePlugin.php
+++ b/plugins/Realtime/RealtimePlugin.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Superclass for plugins that do "real time" updates of timelines using Ajax
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -38,10 +38,10 @@ if (!defined('LACONICA')) {
* this superclass extracts out some of the common functionality
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
class RealtimePlugin extends Plugin
diff --git a/plugins/SimpleUrl/SimpleUrlPlugin.php b/plugins/SimpleUrl/SimpleUrlPlugin.php
new file mode 100644
index 000000000..82d772048
--- /dev/null
+++ b/plugins/SimpleUrl/SimpleUrlPlugin.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Plugin to push RSS/Atom updates to a PubSubHubBub hub
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Plugin
+ * @package StatusNet
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @copyright 2009 Craig Andrews http://candrews.integralblue.com
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ exit(1);
+}
+
+class SimpleUrlPlugin extends Plugin
+{
+ function __construct()
+ {
+ parent::__construct();
+ }
+
+ function onInitializePlugin(){
+ $this->registerUrlShortener(
+ 'is.gd',
+ array(),
+ array('SimpleUrl',array('http://is.gd/api.php?longurl='))
+ );
+ $this->registerUrlShortener(
+ 'snipr.com',
+ array(),
+ array('SimpleUrl',array('http://snipr.com/site/snip?r=simple&link='))
+ );
+ $this->registerUrlShortener(
+ 'metamark.net',
+ array(),
+ array('SimpleUrl',array('http://metamark.net/api/rest/simple?long_url='))
+ );
+ $this->registerUrlShortener(
+ 'tinyurl.com',
+ array(),
+ array('SimpleUrl',array('http://tinyurl.com/api-create.php?url='))
+ );
+ }
+}
+
+class SimpleUrl extends ShortUrlApi
+{
+ protected function shorten_imp($url) {
+ $curlh = curl_init();
+ curl_setopt($curlh, CURLOPT_CONNECTTIMEOUT, 20); // # seconds to wait
+ curl_setopt($curlh, CURLOPT_USERAGENT, 'StatusNet');
+ curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true);
+
+ curl_setopt($curlh, CURLOPT_URL, $this->service_url.urlencode($url));
+ $short_url = curl_exec($curlh);
+
+ curl_close($curlh);
+ return $short_url;
+ }
+}
diff --git a/plugins/TemplatePlugin.php b/plugins/TemplatePlugin.php
index 03daf6219..cfa051162 100644
--- a/plugins/TemplatePlugin.php
+++ b/plugins/TemplatePlugin.php
@@ -8,14 +8,14 @@
* The method is disabled unless the user is #1, the first user of the system
*
* @category Plugin
- * @package Laconica
+ * @package StatusNet
* @author Brian Hendrickson <brian@megapump.com>
* @copyright 2009 Megapump, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://megapump.com/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET')) {
exit(1);
}
@@ -195,16 +195,16 @@ class TemplatePlugin extends Plugin {
);
// use the PHP template
- // unless laconica config:
+ // unless statusnet config:
// $config['template']['mode'] = 'html';
if (!(common_config('template', 'mode') == 'html')) {
- $tpl_file = 'tpl/index.php';
+ $tpl_file = $this->templateFolder() . '/index.php';
$tags = array_merge($vars,$this->blocks);
include $tpl_file;
return;
}
- $tpl_file = 'tpl/index.html';
+ $tpl_file = $this->templateFolder() . '/index.html';
// read the static template
$output = file_get_contents( $tpl_file );
@@ -236,6 +236,9 @@ class TemplatePlugin extends Plugin {
return true;
}
+ function templateFolder() {
+ return 'tpl';
+ }
// catching the StartShowHTML event to halt the rendering
function onStartShowHTML( &$act ) {
@@ -258,7 +261,7 @@ class TemplatePlugin extends Plugin {
* parameter "template", containing the new template code
*
* @category Plugin
- * @package Laconica
+ * @package StatusNet
* @author Brian Hendrickson <brian@megapump.com>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://megapump.com/
@@ -280,7 +283,7 @@ class TemplateAction extends Action
if (!isset($_SERVER['PHP_AUTH_USER'])) {
// not authenticated, show login form
- header('WWW-Authenticate: Basic realm="Laconica API"');
+ header('WWW-Authenticate: Basic realm="StatusNet API"');
// cancelled the browser login form
$this->clientError(_('Authentication error!'), $code = 401);
@@ -300,7 +303,7 @@ class TemplateAction extends Action
$this->clientError(_('only User #1 can update the template'), $code = 401);
// open the old template
- $tpl_file = 'tpl/index.html';
+ $tpl_file = $this->templateFolder() . '/index.html';
$fp = fopen( $tpl_file, 'w+' );
// overwrite with the new template
@@ -323,13 +326,13 @@ class TemplateAction extends Action
}
/**
- * Function for retrieving a laconica display section
+ * Function for retrieving a statusnet display section
*
* requires one parameter, the name of the section
* section names are listed in the comments of the TemplatePlugin class
*
* @category Plugin
- * @package Laconica
+ * @package StatusNet
* @author Brian Hendrickson <brian@megapump.com>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://megapump.com/
diff --git a/plugins/TightUrl/TightUrlPlugin.php b/plugins/TightUrl/TightUrlPlugin.php
new file mode 100644
index 000000000..48efb355f
--- /dev/null
+++ b/plugins/TightUrl/TightUrlPlugin.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Plugin to push RSS/Atom updates to a PubSubHubBub hub
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Plugin
+ * @package StatusNet
+ * @author Craig Andrews <candrews@integralblue.com>
+ * @copyright 2009 Craig Andrews http://candrews.integralblue.com
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://status.net/
+ */
+
+if (!defined('STATUSNET')) {
+ exit(1);
+}
+
+class TightUrlPlugin extends Plugin
+{
+ function __construct()
+ {
+ parent::__construct();
+ }
+
+ function onInitializePlugin(){
+ $this->registerUrlShortener(
+ '2tu.us',
+ array('freeService'=>true),
+ array('TightUrl',array('http://2tu.us/?save=y&url='))
+ );
+ }
+}
+
+class TightUrl extends ShortUrlApi
+{
+ protected function shorten_imp($url) {
+ $response = $this->http_get($url);
+ if (!$response) return $url;
+ $response = $this->tidy($response);
+ $y = @simplexml_load_string($response);
+ if (!isset($y->body)) return $url;
+ $xml = $y->body->p[0]->code[0]->a->attributes();
+ if (isset($xml['href'])) return $xml['href'];
+ return $url;
+ }
+}
diff --git a/plugins/TwitterBridge/daemons/synctwitterfriends.php b/plugins/TwitterBridge/daemons/synctwitterfriends.php
index b7be5d043..0668c6222 100755
--- a/plugins/TwitterBridge/daemons/synctwitterfriends.php
+++ b/plugins/TwitterBridge/daemons/synctwitterfriends.php
@@ -1,8 +1,8 @@
#!/usr/bin/env php
<?php
/*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -38,11 +38,11 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
* Daemon to sync local friends with Twitter friends
*
* @category Twitter
- * @package Laconica
- * @author Zach Copley <zach@controlyourself.ca>
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
$helptext = <<<END_OF_TWITTER_HELP
@@ -143,13 +143,20 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
{
$friends = array();
- $token = TwitterOAuthClient::unpackToken($flink->credentials);
+ $client = null;
- $client = new TwitterOAuthClient($token->key, $token->secret);
+ if (TwitterOAuthClient::isPackedToken($flink->credentials)) {
+ $token = TwitterOAuthClient::unpackToken($flink->credentials);
+ $client = new TwitterOAuthClient($token->key, $token->secret);
+ common_debug($this->name() . '- Grabbing friends IDs with OAuth.');
+ } else {
+ $client = new TwitterBasicAuthClient($flink);
+ common_debug($this->name() . '- Grabbing friends IDs with basic auth.');
+ }
try {
$friends_ids = $client->friendsIds();
- } catch (OAuthCurlException $e) {
+ } catch (Exception $e) {
common_log(LOG_WARNING, $this->name() .
' - cURL error getting friend ids ' .
$e->getCode() . ' - ' . $e->getMessage());
@@ -178,7 +185,7 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
try {
$more_friends = $client->statusesFriends(null, null, null, $i);
- } catch (OAuthCurlException $e) {
+ } catch (Exception $e) {
common_log(LOG_WARNING, $this->name() .
' - cURL error getting Twitter statuses/friends ' .
"page $i - " . $e->getCode() . ' - ' .
diff --git a/plugins/TwitterBridge/daemons/twitterqueuehandler.php b/plugins/TwitterBridge/daemons/twitterqueuehandler.php
index 9aa9d1ed0..f0e76bb74 100755
--- a/plugins/TwitterBridge/daemons/twitterqueuehandler.php
+++ b/plugins/TwitterBridge/daemons/twitterqueuehandler.php
@@ -1,8 +1,8 @@
#!/usr/bin/env php
<?php
/*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
diff --git a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
index 3023bf423..4752ada7c 100755
--- a/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
+++ b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
@@ -1,8 +1,8 @@
#!/usr/bin/env php
<?php
/**
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -47,15 +47,15 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
* system.
*
* @category Twitter
- * @package Laconica
- * @author Zach Copley <zach@controlyourself.ca>
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
// NOTE: an Avatar path MUST be set in config.php for this
-// script to work: e.g.: $config['avatar']['path'] = '/laconica/avatar';
+// script to work: e.g.: $config['avatar']['path'] = '/statusnet/avatar';
class TwitterStatusFetcher extends ParallelizingDaemon
{
@@ -149,9 +149,9 @@ class TwitterStatusFetcher extends ParallelizingDaemon
function getTimeline($flink)
{
- if (empty($flink)) {
+ if (empty($flink)) {
common_log(LOG_WARNING, $this->name() .
- " - Can't retrieve Foreign_link for foreign ID $fid");
+ " - Can't retrieve Foreign_link for foreign ID $fid");
return;
}
@@ -162,17 +162,24 @@ class TwitterStatusFetcher extends ParallelizingDaemon
// to start importing? How many statuses? Right now I'm going
// with the default last 20.
- $token = TwitterOAuthClient::unpackToken($flink->credentials);
+ $client = null;
- $client = new TwitterOAuthClient($token->key, $token->secret);
+ if (TwitterOAuthClient::isPackedToken($flink->credentials)) {
+ $token = TwitterOAuthClient::unpackToken($flink->credentials);
+ $client = new TwitterOAuthClient($token->key, $token->secret);
+ common_debug($this->name() . ' - Grabbing friends timeline with OAuth.');
+ } else {
+ $client = new TwitterBasicAuthClient($flink);
+ common_debug($this->name() . ' - Grabbing friends timeline with basic auth.');
+ }
$timeline = null;
try {
$timeline = $client->statusesFriendsTimeline();
- } catch (OAuthClientCurlException $e) {
+ } catch (Exception $e) {
common_log(LOG_WARNING, $this->name() .
- ' - OAuth client unable to get friends timeline for user ' .
+ ' - Twitter client unable to get friends timeline for user ' .
$flink->user_id . ' - code: ' .
$e->getCode() . 'msg: ' . $e->getMessage());
}
@@ -186,7 +193,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
foreach (array_reverse($timeline) as $status) {
- // Hacktastic: filter out stuff coming from this Laconica
+ // Hacktastic: filter out stuff coming from this StatusNet
$source = mb_strtolower(common_config('integration', 'source'));
@@ -479,7 +486,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
default:
// Note: Twitter's big avatars are a different size than
- // Laconica's (Laconica's = 96)
+ // StatusNet's (StatusNet's = 96)
$avatar->width = 73;
$avatar->height = 73;
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index 280cdb0a3..b49e2e119 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -1,7 +1,7 @@
<?php
/*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -154,72 +154,126 @@ function broadcast_twitter($notice)
TWITTER_SERVICE);
if (is_twitter_bound($notice, $flink)) {
+ if (TwitterOAuthClient::isPackedToken($flink->credentials)) {
+ return broadcast_oauth($notice, $flink);
+ } else {
+ return broadcast_basicauth($notice, $flink);
+ }
+ }
- $user = $flink->getUser();
-
- // XXX: Hack to get around PHP cURL's use of @ being a a meta character
- $statustxt = preg_replace('/^@/', ' @', $notice->content);
+ return true;
+}
- $token = TwitterOAuthClient::unpackToken($flink->credentials);
+function broadcast_oauth($notice, $flink) {
+ $user = $flink->getUser();
+ $statustxt = format_status($notice);
+ // Convert !groups to #hashes
+ $statustxt = preg_replace('/(^|\s)!([A-Za-z0-9]{1,64})/', "\\1#\\2", $statustxt);
+ $token = TwitterOAuthClient::unpackToken($flink->credentials);
+ $client = new TwitterOAuthClient($token->key, $token->secret);
+ $status = null;
+
+ try {
+ $status = $client->statusesUpdate($statustxt);
+ } catch (OAuthClientCurlException $e) {
+ return process_error($e, $flink);
+ }
- $client = new TwitterOAuthClient($token->key, $token->secret);
+ if (empty($status)) {
- $status = null;
+ // This could represent a failure posting,
+ // or the Twitter API might just be behaving flakey.
- try {
- $status = $client->statusesUpdate($statustxt);
- } catch (OAuthClientCurlException $e) {
+ $errmsg = sprintf('Twitter bridge - No data returned by Twitter API when ' .
+ 'trying to send update for %1$s (user id %2$s).',
+ $user->nickname, $user->id);
+ common_log(LOG_WARNING, $errmsg);
- if ($e->getMessage() == 'The requested URL returned error: 401') {
+ return false;
+ }
- $errmsg = sprintf('User %1$s (user id: %2$s) has an invalid ' .
- 'Twitter OAuth access token.',
- $user->nickname, $user->id);
- common_log(LOG_WARNING, $errmsg);
+ // Notice crossed the great divide
- // Bad auth token! We need to delete the foreign_link
- // to Twitter and inform the user.
+ $msg = sprintf('Twitter bridge - posted notice %s to Twitter using OAuth.',
+ $notice->id);
+ common_log(LOG_INFO, $msg);
- remove_twitter_link($flink);
- return true;
+ return true;
+}
- } else {
+function broadcast_basicauth($notice, $flink)
+{
+ $user = $flink->getUser();
- // Some other error happened, so we should probably
- // try to send again later.
+ $statustxt = format_status($notice);
- $errmsg = sprintf('cURL error trying to send notice to Twitter ' .
- 'for user %1$s (user id: %2$s) - ' .
- 'code: %3$s message: $4$s.',
- $user->nickname, $user->id,
- $e->getCode(), $e->getMessage());
- common_log(LOG_WARNING, $errmsg);
+ $client = new TwitterBasicAuthClient($flink);
+ $status = null;
- return false;
- }
- }
+ try {
+ $status = $client->statusesUpdate($statustxt);
+ } catch (BasicAuthCurlException $e) {
+ return process_error($e, $flink);
+ }
- if (empty($status)) {
+ if (empty($status)) {
- // This could represent a failure posting,
- // or the Twitter API might just be behaving flakey.
+ $errmsg = sprintf('Twitter bridge - No data returned by Twitter API when ' .
+ 'trying to send update for %1$s (user id %2$s).',
+ $user->nickname, $user->id);
+ common_log(LOG_WARNING, $errmsg);
- $errmsg = sprint('No data returned by Twitter API when ' .
+ $errmsg = sprintf('No data returned by Twitter API when ' .
'trying to send update for %1$s (user id %2$s).',
$user->nickname, $user->id);
common_log(LOG_WARNING, $errmsg);
+ return false;
+ }
- return false;
- }
+ $msg = sprintf('Twitter bridge - posted notice %s to Twitter using basic auth.',
+ $notice->id);
+ common_log(LOG_INFO, $msg);
- // Notice crossed the great divide
+ return true;
+}
- $msg = sprintf('Twitter bridge posted notice %s to Twitter.',
- $notice->id);
- common_log(LOG_INFO, $msg);
+function process_error($e, $flink)
+{
+ $user = $flink->getUser();
+ $errmsg = $e->getMessage();
+ $delivered = false;
+
+ switch($errmsg) {
+ case 'The requested URL returned error: 401':
+ $logmsg = sprintf('Twiter bridge - User %1$s (user id: %2$s) has an invalid ' .
+ 'Twitter screen_name/password combo or an invalid acesss token.',
+ $user->nickname, $user->id);
+ $delivered = true;
+ remove_twitter_link($flink);
+ break;
+ case 'The requested URL returned error: 403':
+ $logmsg = sprintf('Twitter bridge - User %1$s (user id: %2$s) has exceeded ' .
+ 'his/her Twitter request limit.',
+ $user->nickname, $user->id);
+ break;
+ default:
+ $logmsg = sprintf('Twitter bridge - cURL error trying to send notice to Twitter ' .
+ 'for user %1$s (user id: %2$s) - ' .
+ 'code: %3$s message: %4$s.',
+ $user->nickname, $user->id,
+ $e->getCode(), $e->getMessage());
+ break;
}
- return true;
+ common_log(LOG_WARNING, $logmsg);
+
+ return $delivered;
+}
+
+function format_status($notice)
+{
+ // XXX: Hack to get around PHP cURL's use of @ being a a meta character
+ return preg_replace('/^@/', ' @', $notice->content);
}
function remove_twitter_link($flink)
@@ -227,7 +281,7 @@ function remove_twitter_link($flink)
$user = $flink->getUser();
common_log(LOG_INFO, 'Removing Twitter bridge Foreign link for ' .
- "user $user->nickname (user id: $user->id).");
+ "user $user->nickname (user id: $user->id).");
$result = $flink->delete();
@@ -255,4 +309,3 @@ function remove_twitter_link($flink)
}
}
-
diff --git a/plugins/TwitterBridge/twitterauthorization.php b/plugins/TwitterBridge/twitterauthorization.php
index a54528434..2a93ff13e 100644
--- a/plugins/TwitterBridge/twitterauthorization.php
+++ b/plugins/TwitterBridge/twitterauthorization.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Class for doing OAuth authentication against Twitter
*
@@ -19,15 +19,15 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- * @category Twitter
- * @package Laconica
- * @author Zach Copely <zach@controlyourself.ca>
- * @copyright 2009 Control Yourself, Inc.
+ * @category TwitterauthorizationAction
+ * @package StatusNet
+ * @author Zach Copely <zach@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -36,14 +36,14 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
/**
* Class for doing OAuth authentication against Twitter
*
- * Peforms the OAuth "dance" between Laconica and Twitter -- requests a token,
+ * Peforms the OAuth "dance" between StatusNet and Twitter -- requests a token,
* authorizes it, and exchanges it for an access token. It also creates a link
- * (Foreign_link) between the Laconica user and Twitter user and stores the
+ * (Foreign_link) between the StatusNet user and Twitter user and stores the
* access token and secret in the link.
*
* @category Twitter
- * @package Laconica
- * @author Zach Copley <zach@controlyourself.ca>
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://laconi.ca/
*
diff --git a/plugins/TwitterBridge/twitteroauthclient.php b/plugins/TwitterBridge/twitteroauthclient.php
index b7dc4a80c..bad2b74ca 100644
--- a/plugins/TwitterBridge/twitteroauthclient.php
+++ b/plugins/TwitterBridge/twitteroauthclient.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Class for doing OAuth calls against Twitter
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Integration
- * @package Laconica
- * @author Zach Copley <zach@controlyourself.ca>
- * @copyright 2008 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
+ * @copyright 2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -35,10 +35,10 @@ if (!defined('LACONICA')) {
* Class for talking to the Twitter API with OAuth.
*
* @category Integration
- * @package Laconica
- * @author Zach Copley <zach@controlyourself.ca>
+ * @package StatusNet
+ * @author Zach Copley <zach@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*
*/
class TwitterOAuthClient extends OAuthClient
@@ -81,6 +81,15 @@ class TwitterOAuthClient extends OAuthClient
return new OAuthToken($vals[0], $vals[1]);
}
+ static function isPackedToken($str)
+ {
+ if (strpos($str, chr(0)) === false) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
/**
* Builds a link to Twitter's endpoint for authorizing a request token
*
@@ -109,7 +118,7 @@ class TwitterOAuthClient extends OAuthClient
}
/**
- * Calls Twitter's /stutuses/update API method
+ * Calls Twitter's /statuses/update API method
*
* @param string $status text of the status
* @param int $in_reply_to_status_id optional id of the status it's
@@ -128,7 +137,7 @@ class TwitterOAuthClient extends OAuthClient
}
/**
- * Calls Twitter's /stutuses/friends_timeline API method
+ * Calls Twitter's /statuses/friends_timeline API method
*
* @param int $since_id show statuses after this id
* @param int $max_id show statuses before this id
@@ -158,7 +167,7 @@ class TwitterOAuthClient extends OAuthClient
}
/**
- * Calls Twitter's /stutuses/friends API method
+ * Calls Twitter's /statuses/friends API method
*
* @param int $id id of the user whom you wish to see friends of
* @param int $user_id numerical user id
@@ -188,7 +197,7 @@ class TwitterOAuthClient extends OAuthClient
}
/**
- * Calls Twitter's /stutuses/friends/ids API method
+ * Calls Twitter's /statuses/friends/ids API method
*
* @param int $id id of the user whom you wish to see friends of
* @param int $user_id numerical user id
diff --git a/plugins/TwitterBridge/twittersettings.php b/plugins/TwitterBridge/twittersettings.php
index b3d4a971f..2afa85ba4 100644
--- a/plugins/TwitterBridge/twittersettings.php
+++ b/plugins/TwitterBridge/twittersettings.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Settings for Twitter integration
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Settings
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008-2009 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2008-2009 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}
@@ -38,10 +38,10 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
* Settings for Twitter integration
*
* @category Settings
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*
* @see SettingsAction
*/
@@ -75,7 +75,7 @@ class TwittersettingsAction extends ConnectSettingsAction
* Content area of the page
*
* Shows a form for associating a Twitter account with this
- * Laconica account. Also lets the user set preferences.
+ * StatusNet account. Also lets the user set preferences.
*
* @return void
*/
@@ -160,7 +160,7 @@ class TwittersettingsAction extends ConnectSettingsAction
($flink->noticesync & FOREIGN_NOTICE_RECV) :
false);
$this->elementEnd('li');
-
+ } else {
// preserve setting even if bidrection bridge toggled off
if ($flink && ($flink->noticesync & FOREIGN_NOTICE_RECV)) {
diff --git a/plugins/WikiHashtagsPlugin.php b/plugins/WikiHashtagsPlugin.php
index 6d186a5fe..0c5649aa4 100644
--- a/plugins/WikiHashtagsPlugin.php
+++ b/plugins/WikiHashtagsPlugin.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to show WikiHashtags content in the sidebar
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008 Control Yourself, Inc.
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
+ * @copyright 2008 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET')) {
exit(1);
}
@@ -37,10 +37,10 @@ define('WIKIHASHTAGSPLUGIN_VERSION', '0.1');
* Plugin to use WikiHashtags
*
* @category Plugin
- * @package Laconica
- * @author Evan Prodromou <evan@controlyourself.ca>
+ * @package StatusNet
+ * @author Evan Prodromou <evan@status.net>
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*
* @see Event
*/
@@ -104,6 +104,6 @@ class WikiHashtagsPlugin extends Plugin
function userAgent()
{
return 'WikiHashtagsPlugin/'.WIKIHASHTAGSPLUGIN_VERSION .
- ' Laconica/' . LACONICA_VERSION;
+ ' StatusNet/' . STATUSNET_VERSION;
}
}
diff --git a/plugins/recaptcha/README b/plugins/recaptcha/README
index 3100f697e..ce23a2695 100644
--- a/plugins/recaptcha/README
+++ b/plugins/recaptcha/README
@@ -1,4 +1,4 @@
-Laconica reCAPTCHA plugin 0.2 8/3/09
+StatusNet reCAPTCHA plugin 0.2 8/3/09
====================================
Adds a captcha to your registration page to reduce automated spam bots registering.
diff --git a/plugins/recaptcha/recaptcha.php b/plugins/recaptcha/recaptcha.php
index 38a860fc7..94cf0ccd1 100644
--- a/plugins/recaptcha/recaptcha.php
+++ b/plugins/recaptcha/recaptcha.php
@@ -1,6 +1,6 @@
<?php
/**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
*
* Plugin to show reCaptcha when a user registers
*
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @category Plugin
- * @package Laconica
+ * @package StatusNet
* @author Eric Helgeson <erichelgeson@gmail.com>
* @copyright 2009
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link http://laconi.ca/
+ * @link http://status.net/
*/
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
exit(1);
}