use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI;
+use Friendica\Module\NoScrape;
use Friendica\Network\HTTPException;
use Friendica\Network\Probe;
use Friendica\Protocol\Activity;
DI::cache()->delete(ActivityPub\Transmitter::CACHEKEY_CONTACTS . 'followers:' . $uid);
DI::cache()->delete(ActivityPub\Transmitter::CACHEKEY_CONTACTS . 'following:' . $uid);
+ DI::cache()->delete(NoScrape::CACHEKEY . $uid);
}
/**
namespace Friendica\Module;
use Friendica\BaseModule;
+use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
*/
class NoScrape extends BaseModule
{
+ const CACHEKEY = 'noscrape:';
+
protected function rawContent(array $request = [])
{
$a = DI::app();
System::jsonError(404, 'Profile not found');
}
+ $cachekey = self::CACHEKEY . $owner['uid'];
+ $result = DI::cache()->get($cachekey);
+ if (!is_null($result)) {
+ System::jsonExit($result);
+ }
+
$json_info = [
'addr' => $owner['addr'],
'nick' => $which,
}
}
+ DI::cache()->set($cachekey, $json_info, Duration::DAY);
+
System::jsonExit($json_info);
}
}