Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
24ff9f3
integration with dialogflow
snoort May 30, 2022
bcb2467
reverted consent mechanism back to the way it was
snoort May 30, 2022
b6ff694
planning layout for dialogue flow
snoort May 30, 2022
98304a3
planning layout for dialogue flow
snoort May 30, 2022
dcb2a9e
refactored logic around greeting
snoort May 31, 2022
42c8c08
made it to first action
snoort May 31, 2022
672576b
added date parsing
snoort May 31, 2022
5b99f16
refined date dialogue
snoort May 31, 2022
af4f89c
getting users locationÈ
snoort May 31, 2022
13fa114
getting users locationÈ
snoort May 31, 2022
02b7d18
location enabled
snoort Jun 1, 2022
5a1736c
location and time saved
snoort Jun 1, 2022
58f0bee
data can be displayed, though it is ugly
snoort Jun 1, 2022
a97fcf7
finding way to incorporate intermediate api
snoort Jun 1, 2022
2f5c7ff
added websocket app to collect location
snoort Jun 2, 2022
18538af
made modifications to location app
snoort Jun 2, 2022
11fe6c0
made modifications to location app
snoort Jun 2, 2022
8e1896f
added intermediary api
snoort Jun 2, 2022
a30737a
integrated intermediary api with location
snoort Jun 2, 2022
55d411c
integrated intermediary api with location
snoort Jun 2, 2022
a63ce0e
Add files via upload
snoort Jun 3, 2022
f683d72
location page served
snoort Jun 3, 2022
8020d7b
locationPage is served, fetch request is written but doesn't work
snoort Jun 3, 2022
1312935
locationPage is served, fetch request is written but doesn't work
snoort Jun 3, 2022
16ab09f
location coordinates can be obtained from locationapp
snoort Jun 6, 2022
6ce721d
changed path the locationapp is sent from
snoort Jun 6, 2022
f5b400a
modified location path in api
snoort Jun 6, 2022
7f846ef
changed ids_in_use to set and changed responses of api
snoort Jun 6, 2022
9ebe0d2
changed logic of id verification
snoort Jun 6, 2022
2c35e41
installed poetry and cleaned up
snoort Jun 7, 2022
b15651a
installed poetry and cleaned up
snoort Jun 7, 2022
8b7a7d1
installed poetry and cleaned up
snoort Jun 7, 2022
3c15af1
integrated location_app and chatbot
snoort Jun 7, 2022
1936c15
added questions json
snoort Jun 7, 2022
a6e7d19
we can send a button with questions.json
snoort Jun 8, 2022
3562bad
Logic for consent is done
snoort Jun 8, 2022
bc75623
logic for consent with name is done
snoort Jun 8, 2022
958cc22
flow is coming together, decision button available
snoort Jun 8, 2022
a478a6b
flow is coming together, pass button doesn't work
snoort Jun 8, 2022
0490d74
determining how to incorporate time parsingÈ
snoort Jun 8, 2022
93e4782
the linear flow from greeting to location is done
snoort Jun 9, 2022
243f747
we can get time and location
snoort Jun 9, 2022
06a3048
we can quit to main menu, but quitting the app and coming back has so…
snoort Jun 9, 2022
c9090be
found bug for order of questions
snoort Jun 9, 2022
e2a21a8
added ability to go back to main menu
snoort Jun 9, 2022
5c1c058
consent window is simplified, flow is still bugged
snoort Jun 10, 2022
4cacadb
fixed infinite loop bug
snoort Jun 10, 2022
779c3ec
user can return to where they were but there is a bug concerning time…
snoort Jun 10, 2022
7834ae3
user can return to where they were and the input issue is solved
snoort Jun 10, 2022
93b4da6
fixed a bug
snoort Jun 13, 2022
af8394b
Added the end of the flow
snoort Jun 13, 2022
473893e
made the pass button do something
snoort Jun 13, 2022
8258004
user can enter location and the location will be parsed and sent to g…
snoort Jun 13, 2022
25716f2
locationapi connected to chatbot
snoort Jun 14, 2022
691b1fb
the chatbot reacts when we send the location
snoort Jun 15, 2022
0399997
fixed duplicate id bug
snoort Jun 15, 2022
a45b615
url query for google places works
snoort Jun 15, 2022
ae32226
google api works
snoort Jun 15, 2022
2bef065
google api works
snoort Jun 15, 2022
74fa6bd
updated readme
snoort Jun 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/locationpage.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
}
]
}
88 changes: 88 additions & 0 deletions IntermediateAPI.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import json
from flask import Flask, send_from_directory
from flask import request, Response
import uuid

url = "http"
times = []
ids_and_locations = {}
current_id = ""
senders = []

app = Flask(__name__)

from requests import post


def get_id():
id = str(uuid.uuid1())
return id


@app.route('/url', methods=['GET'])
def get_url():
id = get_id()
return "http://localhost:3000/" + id


@app.route('/<id>', methods=['GET'])
def get_page(id):
if id in ids_and_locations and ids_and_locations[id] is not None:
return Response(status=400)
else:
return send_from_directory('html', "LocationPage.html")


@app.route('/sender', methods=['POST'])
def store_sender():
data = (json.loads(request.data))
print("data: " + str(data))
if str(data["sender"]) not in senders:
senders.append(data["sender"])
print(senders)
return Response(status=200)


@app.route('/sender', methods=['GET'])
def get_sender():
print(senders)
return Response(json.dumps(senders), status=200)


@app.route('/location', methods=['POST'])
def store_location():
data = (json.loads(request.data))
id = data["id"]
ids_and_locations[id] = data["location"]
print(ids_and_locations)
post('http://localhost:5000/location', data["location"])
return Response(status=200)


@app.route('/location/<id>', methods=['GET'])
def get_location(id):
print(ids_and_locations[id]["latitude"])
data = {
"id": id,
"location": {
"latitude": ids_and_locations[id]["latitude"],
"longitude": ids_and_locations[id]["longitude"]
}
}
return Response(json.dumps(data), status=200)


@app.route('/time', methods=['POST'])
def store_time():
data = (json.loads(request.data))
times.append(data)
return Response(status=200)


@app.route('/time', methods=['GET'])
def get_time():
data = json.dumps(times)
return Response(data, status=200)


app.run(port=3000)
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: node index.js
web: node chatbot.js
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ save the url that appears on the console

2. run the application with the command
```bash
node index.js
node chatbot.js
```
to test if the app is up and running, visit the url given to you
by ngrok
Expand Down Expand Up @@ -134,4 +134,13 @@ curl -X POST "https://graph.facebook.com/v2.6/me/subscribed_apps?subscribed_fiel

now if you message your page you should get a response!

### Run the location App

1. The location app runs with python, on port 3000. All you need to do is run the app

### Get a google token

1. Make sure you have a google for developpers account. Generate a key from https://console.cloud.google.com/apis/credentials
and set it as GOOGLE_KEY in environment variables


Loading