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.
This commit is contained in:
parent
8ef29b70d1
commit
6f427d7e43
@ -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.'));
|
||||
|
@ -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();
|
||||
|
@ -1,62 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* StatusNet, the distributed open-source microblogging tool
|
||||
* 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/>.
|
||||
*
|
||||
* @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');
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB |
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user