if this then that IFTTT 实例

if this then that IFTTT 应用实例

在IFTTT注册后登录。在账户显示的地方下拉列表选择【New Applet】.

点击 +this, 选择RSS Feed,

下一步,trigger选择 New Feed Item

填入Feed Url即 rss的地址, 比如 http://36kr.com/feed

然后选择 +that,

搜索webhooks

Make a new web request.

URL填入你接收请求的地址, 比如 http://wechat.yf2017.top/fiIn

Method: POST,

Content-type: application/json

Body: { "markdown"`: {“title”:` `"36Kr",“text”:` `"#### 36Kr [{ {EntryTitle}}]( { {EntryUrl}}) ![screenshot]( { {EntryImageUrl}}) ###### { {EntryPublished}} "` `},` `"msgtype":“markdown”}`

![](http://static.yf2017.top/1528875990000716.png)

下一步,Finish.

接收,以java代码为例

@Controller
public class IftttController extends BaseController{
Logger logger = LoggerFactory.getLogger(this.getClass());
@RequestMapping(value = “/ifIn”)
public String index( @RequestBody String body, HttpServletRequest request, HttpServletResponse response) {
logger.info(body);
return null;
}

}

本文参考 https://open-doc.dingtalk.com/docs/doc.htm?spm=a219a.7629140.0.0.U60cm4&treeId=257&articleId=106438&docType=1

0%