From: Mikael Nordfeldth Date: Sun, 2 Mar 2014 21:58:23 +0000 (+0100) Subject: Remove Twitter from SubMirror X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6f427d7e43ef6cd2f52ea9b03f65c5f9e202931c;p=quix0rs-gnu-social.git Remove Twitter from SubMirror Twitter removed Atom feeds in API v1.1, so there is no way to mirror a feed without screen-scraping or registering a dev account with them. --- diff --git a/plugins/SubMirror/actions/addmirror.php b/plugins/SubMirror/actions/addmirror.php index 0031cf1bf4..4e2e1a0c52 100644 --- a/plugins/SubMirror/actions/addmirror.php +++ b/plugins/SubMirror/actions/addmirror.php @@ -71,10 +71,6 @@ class AddMirrorAction extends BaseMirrorAction switch ($provider) { case 'feed': return $this->trimmed('feedurl'); - case 'twitter': - $screenie = $this->trimmed('screen_name'); - $base = 'http://api.twitter.com/1/statuses/user_timeline.atom?screen_name='; - return $base . urlencode($screenie); default: // TRANS: Exception thrown when a feed provider could not be recognised. throw new Exception(_m('Internal form error: Unrecognized feed provider.')); diff --git a/plugins/SubMirror/actions/basemirror.php b/plugins/SubMirror/actions/basemirror.php index bc5e2b541c..95e2f91597 100644 --- a/plugins/SubMirror/actions/basemirror.php +++ b/plugins/SubMirror/actions/basemirror.php @@ -101,8 +101,8 @@ abstract class BaseMirrorAction extends Action $oprofile = Ostatus_profile::ensureFeedURL($url); } if ($oprofile->isGroup()) { - // TRANS: Client error displayed when trying to mirror a StatusNet group feed. - $this->clientError(_m('Cannot mirror a StatusNet group at this time.')); + // TRANS: Client error displayed when trying to mirror a GNU social group feed. + $this->clientError(_m('Cannot mirror a GNU social group at this time.')); } $this->oprofile = $oprofile; // @todo FIXME: ugly side effect :D return $oprofile->localProfile(); diff --git a/plugins/SubMirror/forms/addtwitter.php b/plugins/SubMirror/forms/addtwitter.php deleted file mode 100644 index 172d321de2..0000000000 --- a/plugins/SubMirror/forms/addtwitter.php +++ /dev/null @@ -1,62 +0,0 @@ -. - * - * @package StatusNet - * @copyright 2010 StatusNet, Inc. - * @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') && !defined('LACONICA')) { - exit(1); -} - -class AddTwitterMirrorForm extends AddMirrorForm -{ - - /** - * Visible or invisible data elements - * - * Display the form fields that make up the data of the form. - * Sub-classes should overload this to show their data. - * - * @return void - */ - function formData() - { - $this->out->hidden('provider', 'twitter'); - $this->out->elementStart('fieldset'); - - $this->out->elementStart('ul'); - - $this->li(); - $this->doInput('addmirror-feedurl', - 'screen_name', - // TRANS: Field label. - _m('Twitter username:'), - $this->out->trimmed('screen_name')); - $this->unli(); - - $this->li(); - // TRANS: Button text for adding a Twitter feed mirror. - $this->out->submit('addmirror-save', _m('BUTTON','Add feed')); - $this->unli(); - $this->out->elementEnd('ul'); - $this->out->elementEnd('fieldset'); - } -} diff --git a/plugins/SubMirror/images/providers/twitter.png b/plugins/SubMirror/images/providers/twitter.png deleted file mode 100644 index 41dabc883e..0000000000 Binary files a/plugins/SubMirror/images/providers/twitter.png and /dev/null differ diff --git a/plugins/SubMirror/lib/addmirrorwizard.php b/plugins/SubMirror/lib/addmirrorwizard.php index 512b2bfa4a..0f8ac266ee 100644 --- a/plugins/SubMirror/lib/addmirrorwizard.php +++ b/plugins/SubMirror/lib/addmirrorwizard.php @@ -64,18 +64,10 @@ class AddMirrorWizard extends Widget // We could accept hostname & username combos here, or // webfingery combinations as for remote users. array( - 'id' => 'statusnet', - 'name' => _m('StatusNet'), + 'id' => 'gnusocial', + 'name' => _m('GNU social'), ), */ - // Accepts a Twitter username and pulls their user timeline as a - // public Atom feed. Requires a working alternate hub which, one - // hopes, is getting timely updates. - array( - 'id' => 'twitter', - // TRANS: Name for possible feed provider. - 'name' => _m('Twitter'), - ), /* // WordPress was on our list some whiles ago, but not sure // what we can actually do here. Search on Wordpress.com hosted @@ -85,26 +77,6 @@ class AddMirrorWizard extends Widget 'name' => _m('WordPress'), ), */ - /* - // In theory, Facebook lets you pull public updates over RSS, - // but the URLs for your own update feed that I can find from - // 2009-era websites no longer seem to work and there's no - // good current documentation. May not still be available... - // Mirroring from an FB account is probably better done with - // the dedicated plugin. (As of March 2011) - array( - 'id' => 'facebook', - 'name' => _m('Facebook'), - ), - */ - /* - // LinkedIn doesn't currently seem to have public feeds - // for users or groups (March 2011) - array( - 'id' => 'linkedin', - 'name' => _m('LinkedIn'), - ), - */ array( 'id' => 'feed', // TRANS: Name for possible feed provider.