Make AS data more general
This commit is contained in:
parent
7a5452c727
commit
4088cdde5b
2 changed files with 11 additions and 4 deletions
|
@ -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
7
config/user.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'displayname' => env('DISPLAY_NAME'),
|
||||
|
||||
'username' => env('USER_NAME'),
|
||||
];
|
Loading…
Add table
Reference in a new issue