Skip to content

Instantly share code, notes, and snippets.

View nfmcclure's full-sized avatar
💭
I may be slow to respond.

Nick nfmcclure

💭
I may be slow to respond.
View GitHub Profile
@nfmcclure
nfmcclure / test_scrape.py
Last active June 7, 2022 14:26
webscrape some test results
import json
import time
import requests
from bs4 import BeautifulSoup
def main():
# ????? UNSURE where to use these two options!!
opts = ['B22', 'BM22']
import requests
cities = ['Las Vegas, NV, US', 'Paris', 'Tokyo, CN']
api_url = 'https://accommodations.booking.com/autocomplete.json'
referer = 'https://www.booking.com/searchresults.html?aid=355028&sid=1c4689c64a9440a81fb0d7ae95196127&sb=1&sb_lp=1&src=index&src_elem=sb&error_url=https%3A%2F%2Fwww.booking.com%2Findex.html%3Faid%3D355028%3Bsid%3D1c4689c64a9440a81fb0d7ae95196127%3Bsb_price_type%3Dtotal%26%3B&ss=Las+Vegas&is_ski_area=0&ssne=Las+Vegas&ssne_untouched=Las+Vegas&dest_id=20079110&dest_type=city&checkin_year=&checkin_month=&checkout_year=&checkout_month=&group_adults=2&group_children=0&no_rooms=1&b_h4u_keep_filters=&from_sf=1'
header = {
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate, br',
@nfmcclure
nfmcclure / simple_classifier.py
Created May 2, 2016 19:16
simple_binary_classifier
import numpy as np
import tensorflow as tf
# Create graph
sess = tf.Session()
# Create data
x_vals = np.concatenate((np.random.normal(-1, 1, 50), np.random.normal(1, 1, 50)))
y_vals = np.concatenate((np.repeat(0, 50), np.repeat(1, 50)))
x_data = tf.placeholder(shape=[1], dtype=tf.float32)