From 6f427d7e43ef6cd2f52ea9b03f65c5f9e202931c Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sun, 2 Mar 2014 22:58:23 +0100 Subject: [PATCH] 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. --- plugins/SubMirror/actions/addmirror.php | 4 -- plugins/SubMirror/actions/basemirror.php | 4 +- plugins/SubMirror/forms/addtwitter.php | 62 ------------------ .../SubMirror/images/providers/twitter.png | Bin 1192 -> 0 bytes plugins/SubMirror/lib/addmirrorwizard.php | 32 +-------- 5 files changed, 4 insertions(+), 98 deletions(-) delete mode 100644 plugins/SubMirror/forms/addtwitter.php delete mode 100644 plugins/SubMirror/images/providers/twitter.png 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 41dabc883ec0c7665054e75380f7ecaac23191e3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1192 zcmV;Z1XufsP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipM> z7cBy$5PseO00byWL_t(o!|j;OYg|FBh)@WKBEf}L5kIPKsv-zt6m2CGHBH(y>7@DSgv{r?Gw0)V zp{X(L+`02ntuSYM;hf(+?|Yu-IR}Xd?xexs4jXNtHc%Vr{|clDG|^1SY{>d_PTU3* zn$DZE>pJbxO2r)R5w4-Jq}UZ^{|(U3Idf`JUMmv;bPKrTntf3g;n;$bWh9kNeH)%G zn^&$>mdZo`3?RhNW{?bFByek>kC%P0qRyo=~-vbptaVFqJKF_sh^ zzUA}lp&^HjM%fQJv!USYb^YCjPK4B>z5HlgbcpSf<`jIDQPpSwz%%gvva%3QB)L_6 zpZsbY6*!&}yTf>6#s!bwN~>oscptB-wF;RnyZcMt{93Hha20|NSLK{bjqA{GgpJ>2 zrR;zF(7J+&Mfvhv`J+``(gXm~!08ngr2lgYCYPkoQK@n4zs%_OmR0tqwG6;)iLSWv zT;4oCXk9FsxsnO43%?ij-cH^KP`{0yA+O3>l3*&UUz?}AhT!sG0KVNYdm@Y@5P>A% z2=-=Ip?`#}70D}%5jf;^e69^RpfrIpmTekoebnWUTZG2%UG@cSwbiYU=a|$d3fnWeMK{Mw1a1TGZQzSx&0nWoMbchJ13wmNv&U@61T_8Xrgij{Kv1A>W zt*XM9k#shrzgbt8U233%`)zzE#va)r?skyXBNTp0t%=qp{Fv3Bt?5}e=nZW!j87!Q z!7diJ&|-CKRv_!pM3-Hf%9`_ey;>n@Km%#|OIkRhh0t%~z9@UJn-4iny%%6zkDf$O z(6ph*GvI0 '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. -- 2.39.5