Make AS data more general

This commit is contained in:
Jonny Barnes 2017-09-13 17:36:20 +01:00
parent 7a5452c727
commit 4088cdde5b
2 changed files with 11 additions and 4 deletions

View file

@ -12,8 +12,8 @@ class ActivityStreamsService
'@context' => 'https://www.w3.org/ns/activitystreams',
'id' => config('app.url'),
'type' => 'Person',
'name' => config('app.display_name'),
'preferredUsername' => 'jonnybarnes',
'name' => config('user.displayname'),
'preferredUsername' => config('user.username'),
]);
return response($data)->header('Content-Type', 'application/activity+json');
@ -23,7 +23,7 @@ class ActivityStreamsService
{
$data = json_encode([
'@context' => 'https://www.w3.org/ns/activitystreams',
'summary' => 'Jonny added a note to his microblog',
'summary' => strtok(config('user.displayname'), ' ') . ' added a note to his microblog',
'type' => 'Add',
'published' => $note->updated_at->toW3cString(),
'actor' => [
@ -33,7 +33,7 @@ class ActivityStreamsService
'url' => config('app.url'),
'image' => [
'type' => 'Link',
'href' => config('app.url') . '/assets/img/jmb-bw.jpg',
'href' => config('app.url') . '/assets/img/profile.jpg',
'mediaType' => '/image/jpeg',
],
],

7
config/user.php Normal file
View file

@ -0,0 +1,7 @@
<?php
return [
'displayname' => env('DISPLAY_NAME'),
'username' => env('USER_NAME'),
];