$s .= '<div id="ifttt-configuration-wrapper">';
$s .= '<p>' . DI::l10n()->t('Create an account at <a href="http://www.ifttt.com">IFTTT</a>. Create three Facebook recipes that are connected with <a href="https://ifttt.com/maker">Maker</a> (In the form "if Facebook then Maker") with the following parameters:') . '</p>';
$s .= '<h4>URL</h4>';
- $s .= '<p>' . DI::baseUrl()->get() . '/ifttt/' . $a->user['nickname'] . '</p>';
+ $s .= '<p>' . DI::baseUrl()->get() . '/ifttt/' . $a->getLoggedInUserNickname() . '</p>';
$s .= '<h4>Method</h4>';
$s .= '<p>POST</p>';
$s .= '<h4>Content Type</h4>';
function ifttt_post(App $a)
{
- if ($a->argc != 2) {
+ if (DI::args()->getArgc() != 2) {
return;
}
- $nickname = $a->argv[1];
+ $nickname = DI::args()->getArgv()[1];
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nickname]);
if (!DBA::isResult($user)) {
//$post['date'] = $item['date'];
//$post['uri'] = $item['url'];
- if (!empty($item['url']) && strstr($item['url'], 'facebook.com')) {
- $hash = hash('ripemd128', $item['url']);
- $post['extid'] = Protocol::FACEBOOK;
- $post['message_id'] = Item::newURI($uid, Protocol::FACEBOOK . ':' . $hash);
- }
-
if ($item['type'] == 'link') {
$link = $item['link'];
$data = PageInfo::queryUrl($item['link']);
$link = hash('ripemd128', $item['msg']);
}
- Post\Delayed::add($link, $post, PRIORITY_MEDIUM, true);
+ Post\Delayed::add($link, $post, PRIORITY_MEDIUM, Post\Delayed::UNPREPARED);
}