Move syndication targets to a config file, fixes #27, also more dynamically generate micropub token
This commit is contained in:
parent
42841eca08
commit
e12b4d39ef
7 changed files with 107 additions and 60 deletions
|
@ -124,35 +124,7 @@ class MicropubController extends Controller
|
|||
//we have a valid token, is `syndicate-to` set?
|
||||
if ($request->input('q') === 'syndicate-to') {
|
||||
return response()->json([
|
||||
'syndicate-to' => [
|
||||
[
|
||||
'uid' => 'https://twitter.com/jonnybarnes',
|
||||
'name' => 'jonnybarnes on Twitter',
|
||||
'service' => [
|
||||
'name' => 'Twitter',
|
||||
'url' => 'https://twitter.com',
|
||||
'photo' => 'https://upload.wikimedia.org/wikipedia/en/9/9f/Twitter_bird_logo_2012.svg',
|
||||
],
|
||||
'user' => [
|
||||
'name' => 'jonnybarnes',
|
||||
'url' => 'https://twitter.com/jonnybarnes',
|
||||
'photo' => 'https://pbs.twimg.com/profile_images/1853565405/jmb-bw.jpg',
|
||||
],
|
||||
],
|
||||
[
|
||||
'uid' => 'https://facebook.com/jonnybarnes',
|
||||
'name' => 'jonnybarnes on Facebook',
|
||||
'service' => [
|
||||
'name' => 'Facebook',
|
||||
'url' => 'https://facebook.com',
|
||||
'photo' => 'https://en.facebookbrand.com/wp-content/uploads/2016/05/FB-fLogo-Blue-broadcast-2.png',
|
||||
],
|
||||
'user' => [
|
||||
'name' => 'jonnybarnes',
|
||||
'url' => 'https://facebook.com/jonnybarnes',
|
||||
],
|
||||
],
|
||||
],
|
||||
'syndicate-to' => config('syndication.targets')
|
||||
]);
|
||||
}
|
||||
//nope, how about a geo URL?
|
||||
|
@ -176,35 +148,7 @@ class MicropubController extends Controller
|
|||
//nope, ho about a config query?
|
||||
if ($request->input('q') == 'config') {
|
||||
return response()->json([
|
||||
'syndicate-to' => [
|
||||
[
|
||||
'uid' => 'https://twitter.com/jonnybarnes',
|
||||
'name' => 'jonnybarnes on Twitter',
|
||||
'service' => [
|
||||
'name' => 'Twitter',
|
||||
'url' => 'https://twitter.com',
|
||||
'photo' => 'https://upload.wikimedia.org/wikipedia/en/9/9f/Twitter_bird_logo_2012.svg',
|
||||
],
|
||||
'user' => [
|
||||
'name' => 'jonnybarnes',
|
||||
'url' => 'https://twitter.com/jonnybarnes',
|
||||
'photo' => 'https://pbs.twimg.com/profile_images/1853565405/jmb-bw.jpg',
|
||||
],
|
||||
],
|
||||
[
|
||||
'uid' => 'https://facebook.com/jonnybarnes',
|
||||
'name' => 'jonnybarnes on Facebook',
|
||||
'service' => [
|
||||
'name' => 'Facebook',
|
||||
'url' => 'https://facebook.com',
|
||||
'photo' => 'https://en.facebookbrand.com/wp-content/uploads/2016/05/FB-fLogo-Blue-broadcast-2.png',
|
||||
],
|
||||
'user' => [
|
||||
'name' => 'jonnybarnes',
|
||||
'url' => 'https://facebook.com/jonnybarnes',
|
||||
],
|
||||
],
|
||||
],
|
||||
'syndicate-to' => config('syndication.targets')
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue