This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require ('express'); | |
var MongoClient = require ('mongodb').MongoClient; | |
var bodyParser = require ('body-parser'); | |
var app = express (); | |
var db = null; | |
MongoClient.connect("mongodb://localhost:27017/mittens", function(err,dbconn) { | |
if (!err) { | |
console.log("we are connected bro!"); | |
db = dbconn; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var bodyParser = require('body-parser'); | |
var request = require ('request'); | |
//api.ai pieces | |
const apiai = require("api.ai"); | |
const nlp = new apiai({ | |
token: "2eb7af67459f4d42b70a0593fd05c4c3"}); | |
//to parse json from the messenger client side |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const express = require('express') | |
const bodyParser = require('body-parser') | |
const request = require('request') | |
const app = express() | |
app.set('port', (process.env.PORT || 5000)) | |
// parse application/x-www-form-urlencoded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def scrape(): | |
browser = webdriver.Chrome('./chromedriver') | |
link = 'https://hqraleigh.spaces.nexudus.com/en/bookings/search' | |
browser.get(link) | |
login_bar = browser.find_element_by_id('login') | |
login_bar.send_keys(<INSERT_YOUR_EMAIL_TO_LOGIN>) | |
password_bar = browser.find_element_by_id('pass') | |
password_bar.send_keys(<INSERT_YOUR_PASSWORD_TO_LOGIN>) | |
login_bar.submit() | |
return scrape |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime as dt | |
year = dt.now().year | |
month = dt.now().month | |
day = dt.now().day | |
for i in str(month): | |
if month == 1: | |
month = "January" | |
elif month == 2: | |
month = "February" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime as dt | |
minute = dt.now().minute | |
if minute <= 60: | |
if minute <=15: | |
time = 15 | |
elif minute <=30: | |
time = 30 | |
elif minute <=45: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime as dt | |
hour = dt.now().hour | |
for i in str(hour): | |
if hour < 12 and time != '00': | |
current_hour = hour | |
end_hour = current_hour + 1 | |
period = "AM" | |
elif hour < 12 and time == '00': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime as dt | |
begin_time_of_room = str(hq_date) + ' ' + '-' + ' ' + str(current_hour) + ":" + str(time) + ' ' + str(period) | |
end_time_of_room = str(hq_date) + ' ' + '-' + ' ' + str(end_hour) + ":" + str(time) + ' ' + str(period) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
end_time.send_keys(end_time_of_room) | |
begin_time.send_keys(begin_time_of_room) | |
t.sleep(5) |
OlderNewer