Browse Source

also send text version of the post as summary

pull/10/head
Aaron Parecki 9 years ago
parent
commit
77132cdd48
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      controllers/controllers.php

+ 9
- 1
controllers/controllers.php View File

@ -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);

Loading…
Cancel
Save