Top Banner
Bot 甘苦談,使用者至上 Maxis Kao @ Yahoo Search
72

Bot 甘苦談,使用者至上

Jan 09, 2017

Download

Engineering

Maxis Kao
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Bot 甘苦談,使用者至上

Bot 甘苦談,使用者至上Maxis Kao @ Yahoo Search

Page 2: Bot 甘苦談,使用者至上

什麼是 Bot

Page 3: Bot 甘苦談,使用者至上
Page 4: Bot 甘苦談,使用者至上
Page 5: Bot 甘苦談,使用者至上
Page 6: Bot 甘苦談,使用者至上
Page 7: Bot 甘苦談,使用者至上
Page 8: Bot 甘苦談,使用者至上

程序員鼓勵師

Page 9: Bot 甘苦談,使用者至上
Page 10: Bot 甘苦談,使用者至上
Page 11: Bot 甘苦談,使用者至上
Page 13: Bot 甘苦談,使用者至上
Page 14: Bot 甘苦談,使用者至上

Nov. 6, 2015

Page 15: Bot 甘苦談,使用者至上

PTT 表特版

Page 16: Bot 甘苦談,使用者至上

Heroku + MongoLab + Slack APINode MongoDB Webhook

Page 17: Bot 甘苦談,使用者至上

Heroku + MongoLab + Slack APINode MongoDB Webhook

Page 18: Bot 甘苦談,使用者至上

Heroku + MongoLab + Slack APINode MongoDB Webhook

Page 19: Bot 甘苦談,使用者至上

> db.beauty.lists.findOne()

{

"_id" : ObjectId("563b17bef26ec7b20aabe962"),

"push" : 26,

"full_title" : "[正妹] 又正又會讀書",

"tag" : "正妹",

"title" : "又正又會讀書",

"url" : "https://www.ptt.cc/bbs/Beauty/M.1446701090.A.658.html",

"post_id" : "M.1446701090.A.658",

"mark" : "",

"fetched" : true,

"raw_meta" : {

"作者" : "pk698326889 (JiMiHua)",

"看板" : "Beauty",

"標題" : "[正妹] 又正又會讀書",

"時間" : "Thu Nov 5 13:24:47 2015"

},

"author" : "pk698326889 (JiMiHua)",

"image_count" : 8,

"datetime" : ISODate("2015-11-05T05:24:47Z"),

"display" : 2

}

Page 20: Bot 甘苦談,使用者至上

> db.beauty.posts.findOne()

{

"_id" : ObjectId("563b5a3af3526d750e61f5ad"),

"img_total" : 35,

"post_id" : "M.1446558454.A.167",

"img_idx" : 0,

"img_url" : "http://i.imgur.com/h4f2E15.jpg",

"display" : 1

}

Page 21: Bot 甘苦談,使用者至上

鼓勵 +長腿 >50

Page 22: Bot 甘苦談,使用者至上
Page 23: Bot 甘苦談,使用者至上
Page 24: Bot 甘苦談,使用者至上
Page 25: Bot 甘苦談,使用者至上

4,735 posts

37,849 images

Page 26: Bot 甘苦談,使用者至上
Page 27: Bot 甘苦談,使用者至上

ButSide effects

Page 28: Bot 甘苦談,使用者至上

鼓勵 + 新加坡 = 悲劇

Page 29: Bot 甘苦談,使用者至上
Page 30: Bot 甘苦談,使用者至上
Page 31: Bot 甘苦談,使用者至上

> db.beauty.lists.findOne()

{

"_id" : ObjectId("563b17bef26ec7b20aabe962"),

"push" : 26,

"full_title" : "[正妹] 又正又會讀書",

"tag" : "正妹",

"title" : "又正又會讀書",

"url" : "https://www.ptt.cc/bbs/Beauty/M.1446701090.A.658.html",

"post_id" : "M.1446701090.A.658",

"mark" : "",

"fetched" : true,

"raw_meta" : {

"作者" : "pk698326889 (JiMiHua)",

"看板" : "Beauty",

"標題" : "[正妹] 又正又會讀書",

"時間" : "Thu Nov 5 13:24:47 2015"

},

"author" : "pk698326889 (JiMiHua)",

"image_count" : 8,

"datetime" : ISODate("2015-11-05T05:24:47Z"),

"display" : 2

}

Page 32: Bot 甘苦談,使用者至上

使用者要什麼,就給他什麼

「X,給我男的是要鼓勵什麼?」

Page 33: Bot 甘苦談,使用者至上

版本控制也救不了你

Page 34: Bot 甘苦談,使用者至上

$ git checkout tags/v1.7

Page 35: Bot 甘苦談,使用者至上

$ npm install [email protected]

Page 36: Bot 甘苦談,使用者至上
Page 37: Bot 甘苦談,使用者至上

BDDBehavior-driven development

Page 38: Bot 甘苦談,使用者至上

重質不重量

Page 39: Bot 甘苦談,使用者至上

Quality

VolumeRevenue

Page 40: Bot 甘苦談,使用者至上

Quality

VolumeRevenue

Page 41: Bot 甘苦談,使用者至上

Quality

VolumeRevenue

Page 42: Bot 甘苦談,使用者至上

為使用者設想

Page 43: Bot 甘苦談,使用者至上
Page 44: Bot 甘苦談,使用者至上
Page 45: Bot 甘苦談,使用者至上
Page 46: Bot 甘苦談,使用者至上

$ clear

Page 47: Bot 甘苦談,使用者至上

https://www.npmjs.com/package/lorem-ipsum

Page 48: Bot 甘苦談,使用者至上
Page 49: Bot 甘苦談,使用者至上

簡化常見的指令

Page 50: Bot 甘苦談,使用者至上

4,600searches in the query log

Page 51: Bot 甘苦談,使用者至上
Page 52: Bot 甘苦談,使用者至上

> _________

Page 53: Bot 甘苦談,使用者至上

> _________Alan

Page 54: Bot 甘苦談,使用者至上

> _________Conrad

Page 55: Bot 甘苦談,使用者至上

> _________布萊恩

Page 56: Bot 甘苦談,使用者至上

user log 是珍貴的資產

看著儀表板開車

Page 57: Bot 甘苦談,使用者至上

鼓勵師 v2.0

Page 58: Bot 甘苦談,使用者至上

Heroku + MongoLab + Slack API

Page 59: Bot 甘苦談,使用者至上

Heroku + MongoLab + Slack API

3~5 s (including dyno sleeping)

Page 60: Bot 甘苦談,使用者至上

Heroku + MongoLab + Slack API

3~5 s 1 s3~5 s

Page 61: Bot 甘苦談,使用者至上

Heroku + MongoLab + Slack API

1 s3~5 s

Page 62: Bot 甘苦談,使用者至上
Page 63: Bot 甘苦談,使用者至上
Page 64: Bot 甘苦談,使用者至上
Page 65: Bot 甘苦談,使用者至上

NodeMongoDB

Page 66: Bot 甘苦談,使用者至上

PREPROCESSING: 0ms

DB_CONNECT: 8ms

QUERY_LOGGING: 4ms

RECORD_COUNT: 1ms

CONDITION_SEARCH: 57ms

Ping: 8ms Webhook: 30ms

server mongodb slack

Page 67: Bot 甘苦談,使用者至上

30x faster3s → 100ms

Page 68: Bot 甘苦談,使用者至上

鼓勵師 v3.0

Page 69: Bot 甘苦談,使用者至上

Elasticsearch

● Full-text search● Analytics● High Availability

Page 70: Bot 甘苦談,使用者至上

Feedback

● Personalization● User preference

Page 71: Bot 甘苦談,使用者至上

Recommendation