Skip to content

Instantly share code, notes, and snippets.

@r3-yamauchi
r3-yamauchi / kintone_post_comment.json
Last active October 25, 2017 02:29
Webhook と Microsoft Flow を使って、プログラミングせずに kintone であれこれ https://blog.r3it.com/20170713-kintone-webhook-ms-flow-1-66e5355f51d2
{
"app": 133,
"record": 1,
"comment": {
"text": "「このハゲー!」\n「違うだろー!違うだろー!」",
"mentions": [
{
"code": "Administrator",
"type": "USER"
}
@r3-yamauchi
r3-yamauchi / firestore_on_kintone.js
Last active October 25, 2017 02:28
Cloud Firestore を使って kintone へ プッシュ通知する https://blog.r3it.com/cloud-firestore-with-kintone-aaa50fcea1c7
(function () {
"use strict";
firebase.initializeApp({
apiKey: "XXxxXxXXXx99x9XX-xxx_xxXxXXXXXXxXXxXXxX",
authDomain: "projectId.firebaseapp.com",
projectId: "projectId"
});
// Initialize Cloud Firestore through Firebase
@r3-yamauchi
r3-yamauchi / firestore_basic.js
Last active October 25, 2017 02:28
Cloud Firestore を使って kintone へ プッシュ通知する https://blog.r3it.com/cloud-firestore-with-kintone-aaa50fcea1c7
(function () {
"use strict";
firebase.initializeApp({
apiKey: "XXxxXxXXXx99x9XX-xxx_xxXxXXXXXXxXXxXXxX",
authDomain: "projectId.firebaseapp.com",
projectId: "projectId"
});
// Initialize Cloud Firestore through Firebase
@r3-yamauchi
r3-yamauchi / PdfView.jsx
Last active November 16, 2017 05:29
kintone のカスタマイズで React を使うと何が嬉しいか https://blog.r3it.com/react-on-kintone-1008c63ca808
import React from "react";
export default class PdfView extends React.Component {
constructor(props) {
super(props);
this.state = {
height: this.props.height,
fileKey: this.props.fileKey
};
@r3-yamauchi
r3-yamauchi / get-kintone-records-json.js
Last active November 16, 2017 05:30
kintone のデータを Elasticsearch に入れて検索する https://blog.r3it.com/elasticsearch-firststep-88f58f0061d7
const util = require("./QueryKintoneRecords");
const fs = require("fs");
const env = JSON.parse(fs.readFileSync("./config/env.json"));
const queryKintoneRecords = new util.QueryKintoneRecords(env.domain, env.appId, env.apiToken);
const filepath = "./output/output.json";
describe("JSON出力", function () {
it("kintoneから取得・ファイル書き込み", function (done) {
@r3-yamauchi
r3-yamauchi / kintone-records-json-to-es-test.js
Last active November 16, 2017 05:30
kintone のデータを Elasticsearch に入れて検索する https://blog.r3it.com/elasticsearch-firststep-88f58f0061d7
const fs = require("fs");
const filepath = "./output/output.json";
const elasticsearch = require("elasticsearch");
const ES_INDEX = "kintone"; // Elasticsearch index name
const ES_TYPE = "log"; // Elsticsearch index type name
const ES_CLIENT = new elasticsearch.Client({
host: "127.0.0.1:9200" // Elasticsearch URL:port
});
@r3-yamauchi
r3-yamauchi / Elasticsearch.vue
Created November 7, 2017 00:40
Elasticsearch を使って検索する機能を kintone プラグイン化する https://blog.r3it.com/elasticsearch-on-kintone-6eccb369eb53
<template>
<div>
<input type="text" autocomplete="off" v-model="userinput">
<ul>
<li v-for="item in items">
{{ item.dispText }}
</li>
</ul>
</div>
</template>
@r3-yamauchi
r3-yamauchi / entry.jsx
Last active November 17, 2017 12:34
Google Pickerを使って場所(緯度・経度)を選択させる https://blog.r3it.com/google-picker-map-81ad931d5bd0
// @flow
import React from "react";
import { render } from "react-dom";
import Picker from "./Picker";
(function () {
kintone.events.on(["app.record.create.show", "app.record.edit.show"], (event: Kintone.RecordEvent) => {
const elm = kintone.app.record.getSpaceElement("space1");
@r3-yamauchi
r3-yamauchi / Picker.jsx
Last active November 17, 2017 12:33
Google Pickerを使って場所(緯度・経度)を選択させる https://blog.r3it.com/google-picker-map-81ad931d5bd0
import React, { Component } from "react";
import PropTypes from "prop-types";
import loadScript from "load-script";
let scriptLoadingStarted = false;
export default class GoogleChooser extends React.Component {
static propTypes = {
children: PropTypes.node,
onChange: PropTypes.func,
@r3-yamauchi
r3-yamauchi / index.js
Created November 17, 2017 16:40
kintone のデータを使って Amazon Echo を朝礼当番にする https://blog.r3it.com/amazon-echo-with-kintone-38ebc81ce42f
'use strict';
var Alexa = require('alexa-sdk');
var https = require('https');
var querystring = require('querystring');
//=========================================================================================================================================
//TODO: このコメント行より下の項目に注目してください。
//=========================================================================================================================================
//Replace with your app ID (OPTIONAL). You can find this value at the top of your skill's page on http://developer.amazon.com.