Skip to content
Permalink
Browse files

initial implementation of botstack framework

  • Loading branch information...
jcoenraadts committed Jan 19, 2017
1 parent 504e563 commit 7e742a991b97e87fc48f690a57bee440306475b2
Showing with 1,183 additions and 0 deletions.
  1. +247 βˆ’0 .gitignore
  2. +1 βˆ’0 ProcFile
  3. +21 βˆ’0 README.md
  4. +57 βˆ’0 json/apiai.json
  5. +25 βˆ’0 json/fb.json
  6. +22 βˆ’0 package.json
  7. +25 βˆ’0 public/index.html
  8. +104 βˆ’0 repost-bot.njsproj
  9. +34 βˆ’0 server.js
  10. +22 βˆ’0 src/api-ai-webhook.js
  11. +58 βˆ’0 src/api-ai.js
  12. +11 βˆ’0 src/aws.js
  13. +25 βˆ’0 src/bot-metrics.js
  14. +60 βˆ’0 src/botlyitcs.js
  15. +66 βˆ’0 src/dynamodb.js
  16. +230 βˆ’0 src/fb.js
  17. +55 βˆ’0 src/s3.js
  18. +54 βˆ’0 src/session.js
  19. +13 βˆ’0 src/webhook_get.js
  20. +53 βˆ’0 src/webhook_post.js
@@ -0,0 +1,247 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Xx]64/
[Xx]86/
[Bb]uild/
bld/
[Bb]in/
[Oo]bj/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml

# TODO: Un-comment the next line if you do not want to checkin
# your web deploy settings because they may include unencrypted
# passwords
#*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Microsoft Azure ApplicationInsights config file
ApplicationInsights.config

# Windows Store app package directory
AppPackages/
BundleArtifacts/

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# LightSwitch generated files
GeneratedArtifacts/
ModelManifest.xml

# Paket dependency manager
.paket/paket.exe

# FAKE - F# Make
.fake/

.vscode/
@@ -0,0 +1 @@
ο»Ώweb: node index.js
@@ -0,0 +1,21 @@
# repost-bot

## API.AI Data Storage Hook
* Any `json` POSTed to this endpoint will be stored in the database, provided it includes a string property called `id`
* This endpoint is designed for logging webhook data from API.ai.
* Data sent to this endpoint is inserted into table `repost-apiai-logs` in AWS DynamoDB

```
POST https://repost-bot.herokuapp.com/apiaidb/
Headers:
Content-type: application/json
Post Body:
{
id: 'cc8ca971-0eec-4a04-ab54-d2af01e4674e',
/* arbitrary json properties */
}
```

@@ -0,0 +1,57 @@
{
"id": "62471b8c-ecae-4878-aa72-cd3954359b76",
"timestamp": "2016-12-22T11:38:25.478Z",
"result": {
"source": "agent",
"resolvedQuery": "QuickReply",
"action": "",
"actionIncomplete": false,
"parameters": {},
"contexts": [],
"metadata": {
"intentId": "7ad68031-9fe4-4bd6-983c-be2c2f9cb769",
"webhookUsed": "false",
"webhookForSlotFillingUsed": "false",
"intentName": "QuickReplyTest"
},
"fulfillment": {
"speech": "",
"messages": [
{
"title": "Please Choose",
"replies": [
"Yes",
"No"
],
"type": 2
},
{
"title": "Image Title",
"subtitle": "Subtitle",
"imageUrl": "https://goo.gl/images/J8eNF6",
"buttons": [
{
"text": "Hello",
"postback": "postback"
},
{
"text": "Hello again",
"postback": "https://google.com"
},
{
"text": "3rd time",
"postback": "https://goo.gl/images/J8eNF6"
}
],
"type": 1
}
]
},
"score": 1
},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "7537e3ae-78cd-4796-b485-e3c3f08b99b1"
}
@@ -0,0 +1,25 @@
{
"object": "page",
"entry": [
{
"id": "125172004554685",
"time": 1482401097497,
"messaging": [
{
"sender": {
"id": "999914126763049"
},
"recipient": {
"id": "125172004554685"
},
"timestamp": 1482401097402,
"message": {
"mid": "mid.1482401097402:c2646f9921",
"seq": 1353,
"text": "hello"
}
}
]
}
]
}
@@ -0,0 +1,22 @@
{
"name": "repost-bot",
"version": "0.0.0",
"description": "repost-bot",
"main": "server.js",
"author": {
"name": "joel",
"email": ""
},
"dependencies": {
"apiai": "^2.0.1",
"aws-sdk": "^2.5.3",
"dashbot": "^0.7.4",
"node-botmetrics": "0.0.1",
"node-emoji": "^1.3.1",
"oauth2-server": "^2.4.1",
"q": "^1.4.1",
"request": "^2.72.0",
"restify": "^4.1.1",
"uuid": "^3.0.0"
}
}
Oops, something went wrong.

0 comments on commit 7e742a9

Please sign in to comment.
You can’t perform that action at this time.