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