Forked from bastianallgeier/ifttt-instagram-to-blog.php
Created
September 26, 2016 05:14
-
-
Save bugsysop/7e7c635178a54c3ad9d6776e9575ed57 to your computer and use it in GitHub Desktop.
IFTTT Make channel action to create blog post from new post on Instagram
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment