Answers:
有一种方法可以执行此操作,但是它可能有点复杂,并且需要带有php 5的Unix Web主机,因此请注意。
步骤1
您要做的第一件事是添加制作者频道。您可以通过单击页面顶部的“频道”并搜索它,然后单击它并按“添加频道”按钮,以与添加任何其他频道相同的方式进行操作。
第2步
在您的虚拟主机上创建一个空白的php文档。只要您可以使用浏览器访问它,那么实际上并不重要。
第三步
您现在要做的是制作一个食谱,在其中您的触发器激活制作者频道。设置好触发器后,只需点击制造商频道,然后点击“发出网络请求”即可。然后在“ URL”字段中输入在步骤2中创建的文档的Web URL。将方法更改为GET,并将其他字段保留为空白。
步骤4
现在制作由网络请求触发的配方。只要记住它,就可以根据需要设置事件名称。随心所欲地使食谱的“那个”成为可能。
第5步
现在,我们将代码添加到我们在步骤2中制作的PHP文档中。添加此代码,更改允许的时间(当前为上午6点),通过时间,时区以及您将在其中更改“ example-key”的URL。到您的密钥(在此处找到),{{event}}到您在步骤4中命名的事件。
<?php
date_default_timezone_set("EST");
$time = strftime("%H");
if($time == 6){
echo exec('curl -X POST https://maker.ifttt.com/trigger/{{event}}/with/key/example-key');
}
}
?>
保存文档,您就完成了。
不是我的,但这对我很有用!转到https://platform.ifttt.com/maker并创建applet,并在过滤器代码部分中使用它。* .skip()对于设置触发后取消动作很重要。PS不是编码员!
// Change startTime and stopTime to set the time range when you want
// your service's action (the 'That') to happen:
//
var startTime = moment('03:00 pm', "HH:mm a");
var stopTime = moment('06:00 pm', "HH:mm a");
//
// startTime is the first time when the action can happen
// stopTime is the last time the action can happen... until time
// reaches the next startTime.
//
// Notes:
// - startTime can be later than stopTime. For example, startTime
// can be 10:00pm and stopTime 06:00am. This means actions can
// happen from 10pm of one day until 6am of the next day but
// not between 6am and 10pm of either day.
//
// - startTime cannot be the same as stopTime
//
// - 'Skip' messages are written when the service's action does not
// happen, such as after the stopTime and before the next
// start time.
//
// - If you want to use this code with a service other than
// Gmail.sendYourselfAnEmail, you must change the lines that
// reference Gmail.sendYourselfAnEmail.skip to the skip method
// for your service.
//
// --------------------------
//
// The code converts everything to minutes for comparision purposes
//
var startTimeMinutes = startTime.minutes() + startTime.hours() * 60;
var stopTimeMinutes = stopTime.minutes() + stopTime.hours() * 60;
var triggerTimeMinutes = Meta.triggerTime.minutes() + Meta.triggerTime.hours()* 60;
//
// StartTime = stopTime not allowed.
//
// Set some defaults...
//
var doThat = new Boolean(false);
var whatsup = "'That' has been skipped";
//
// If start time is less than stop time, then the range is assumed to
// be a continuous period during a single day. E.g., 9am-6pm.
//
if ((startTimeMinutes<stopTimeMinutes)
&& (triggerTimeMinutes >= startTimeMinutes
&& triggerTimeMinutes <= stopTimeMinutes))
{
doThat = Boolean(true);
whatsup = "range within a single day";
}
//
// If start time > stop time, then the range is assumed to span
// midnight (12am). E.g. 10pm-6am. This range covers parts of two
// days.
//
else if ((startTimeMinutes>stopTimeMinutes)
&& (triggerTimeMinutes > startTimeMinutes
|| triggerTimeMinutes < stopTimeMinutes))
{
doThat = Boolean(true);
whatsup = "range spans midnight";
}
//
// Out of range...
//
if (doThat == false)
{
AndroidMessages.sendAMessage.skip("Event happened outside time range (" + whatsup +") - time of trigger was "+Meta.triggerTime.format('LT')+", but start time to allow the action is "+ startTime.format('LT') + " and stop time is "+ stopTime.format('LT') + " Debug info: minutes are "+triggerTimeMinutes + " " + startTimeMinutes + " " + stopTimeMinutes);
}
//
// The following code can be uncommented for debugging. It writes
// an entry to the activity log instead of performing the
// action.
//
// else
// {
// IfNotifications.sendNotification.setMessage("Action can happen (" + whatsup +") - time of trigger was "+Meta.triggerTime.format('LT')+", start time is "+ startTime.format('LT') + ", and stop time is "+ stopTime.format('LT') + ". Debug info: Minutes are trigger="+triggerTimeMinutes + ", start=" + startTimeMinutes + ", and stop=" + stopTimeMinutes);
// }
// }
实现此目标的另一种方法(不依靠创建手动小程序)是使用Stringify.com作为中间人。
它允许您在流中包括“仅当”节点(Stringify流= IFTTT配方)。如果您足够幸运,Stringify已经支持您要触发的内容,但是与IFTTT上的众多功能相比,它们仅支持少数“事物”。
您可以在IFTTT上设置将触发Stringify触发器的“输入”配方,以及从Stringify操作触发的“输出”配方。
例如: