From 77132cdd485822a1b83755d8076cd39c2fc1496e Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Fri, 24 Apr 2015 22:16:14 -0700 Subject: [PATCH] also send text version of the post as summary --- controllers/controllers.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/controllers/controllers.php b/controllers/controllers.php index e5f82e0..8d2864c 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -159,18 +159,23 @@ $app->post('/post', function() use($app) { if(k($params, 'drank')) { $entry->content = trim($params['drank']); $type = 'drink'; + $verb = 'drank'; } elseif(k($params, 'drink')) { $entry->content = trim($params['drink']); $type = 'drink'; + $verb = 'drank'; } elseif(k($params, 'eat')) { $entry->content = trim($params['eat']); $type = 'eat'; + $verb = 'ate'; } elseif(k($params, 'custom_drink')) { $entry->content = trim($params['custom_drink']); $type = 'drink'; + $verb = 'drank'; } elseif(k($params, 'custom_eat')) { $entry->content = trim($params['custom_eat']); $type = 'eat'; + $verb = 'ate'; } $entry->type = $type; @@ -181,11 +186,14 @@ $app->post('/post', function() use($app) { $url = false; if($user->micropub_endpoint) { + $text_content = 'Just ' . $verb . ': ' . $entry->content; + $mp_request = array( 'h' => 'entry', 'p3k-food' => $entry->content, 'p3k-type' => $type, - 'location' => k($params, 'location') + 'location' => k($params, 'location'), + 'summary' => $text_content ); $r = micropub_post($user->micropub_endpoint, $mp_request, $user->access_token);