Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / 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"
}