diff --git a/config.php.sample b/config.php.sample index 613c904..1651aec 100644 --- a/config.php.sample +++ b/config.php.sample @@ -44,6 +44,9 @@ $config = array( ), ), + # the IndieAuth token endpoint to use + 'token_endpoint' => 'https://tokens.indieauth.com/token', + # the timezone to use for all times 'tz' => 'America/New_York', diff --git a/inc/content.php b/inc/content.php index d5f2fa1..71e7ad5 100644 --- a/inc/content.php +++ b/inc/content.php @@ -208,10 +208,15 @@ function create($request, $photos = []) { # pull out just the content, so that $properties can be front matter # NOTE: content may be in ['content'] or ['content']['html']. - if (is_array($properties['content']) && isset($properties['content']['html'])) { - $content = $properties['content']['html']; + # NOTE 2: there may be NO content! + if (isset($properties['content'])) { + if (is_array($properties['content']) && isset($properties['content']['html'])) { + $content = $properties['content']['html']; + } else { + $content = $properties['content']; + } } else { - $content = $properties['content']; + $content = ''; } # ensure that the properties array doesn't contain 'content' unset($properties['content']); diff --git a/inc/twitter.php b/inc/twitter.php index 22475e0..06c0127 100644 --- a/inc/twitter.php +++ b/inc/twitter.php @@ -56,8 +56,8 @@ function syndicate_twitter($config, $properties, $content, $url) { # URL of our instance of it. if (isset($properties['repost-of'])) { $id = get_tweet_id($properties['repost-of']); - $tweet = $t->post('statuses/retweet/', ['id' => $id]); - if (! $t->getLastHttpCode() == 200) { + $tweet = $t->post("statuses/retweet/$id"); + if ($t->getLastHttpCode() != 200) { return false; } return build_tweet_url($tweet);