Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bastianallgeier/ba38bfe424a4c94fa33cb70e50f820ec to your computer and use it in GitHub Desktop.
Save bastianallgeier/ba38bfe424a4c94fa33cb70e50f820ec to your computer and use it in GitHub Desktop.
IFTTT Make channel action to create blog post from new post on Instagram
<?php
/* if this script is located in your document root… */
require(__DIR__ . '/kirby/bootstrap.php');
if(get('params')) {
$articles = page('blog')->children();
$sort = ($articles->count() + 1);
$date = date('Y-m-d');
$dirname = $date . '-' . $sort;
$article = $articles->create($dirname, 'article', [
'title' => get('caption'),
'date' => $date,
'text' => get('params'),
'blogid' => $sort,
]);
$article->sort($sort);
}
@brendandawes
Copy link

Brilliant. Had no idea Kirby could create articles like that.

@brendandawes
Copy link

Tried to get the url of the created post by doing $article->url() but weirdly it returns the url of the script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment