friendica/src/Module/RandomProfile.php

28 lines
485 B
PHP
Raw Normal View History

<?php
namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
/**
2019-05-18 21:12:22 -04:00
* Redirects to a random Friendica profile this node knows about
*/
class RandomProfile extends BaseModule
{
2019-11-05 15:22:54 -05:00
public static function content($parameters)
{
$a = self::getApp();
$contactUrl = GContact::getRandomUrl();
if ($contactUrl) {
$link = Contact::magicLink($contactUrl);
$a->redirect($link);
}
$a->internalRedirect('profile');
}
}