friendica-github/src/Module/RandomProfile.php

29 lines
509 B
PHP
Raw Normal View History

<?php
namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
/**
2019-05-19 01:12:22 +00:00
* Redirects to a random Friendica profile this node knows about
*/
class RandomProfile extends BaseModule
{
public static function content(array $parameters = [])
{
$a = DI::app();
$contactUrl = GContact::getRandomUrl();
if ($contactUrl) {
$link = Contact::magicLink($contactUrl);
$a->redirect($link);
}
$a->internalRedirect('profile');
}
}