Andrews-monitor - A Go program to monitor when times were available to order for Brown's Andrews dining hall. Used during the portion of the pandemic when the dining hall was only available for online order.

Andrews Dining Hall Monitor

A Go program to monitor when times were available to order for Brown's Andrews dining hall. Used during the portion of the pandemic when the dining hall was only available for online order.

A Few Notes

Just a couple of things to note!

How to use it

  • As will be mentioned before, this bot is obsolete and just for educational purposes. But, all it would require to run is the user to input their info into config/config.go
  • It takes Twilio API info for the SMS messaging as well as a Discord Webhook URL (in addition to the username/password to log in)

What could be done better

  • For the parsing, I just wrote a really janky parsing helper function because I did this all in one afternoon. A more elegant solution might be using the GoQuery package for JQuery parsing, or possibly RegEx
  • I didn't feel like messing around with GoQuery as it would add more parsing time compared to the janky string parsing I did, and I didn't want to deal with RegEx for such a silly and quick project
  • Honestly, you might not need all the headers for DUO login but in the bot business, I always just copy the same exact headers that a manual user would have when using Chrome. I always find it better to blend in
  • On that same note, when I compile on my local computer this bot also used my modified Go HTTP client that had spoofed TLS ClientHello packets as well as modified HTTP2 code to appear very similar to Google Chrome's request. Again, this was far overkill and if you don't know what that means then don't worry because it's entirely irrelevant to the code of this bot/monitor
  • There's also just some generally sloppy code. For example, I just assume there will be a Location header on a status 302 redirect when in reality there is no guarantee of one!

Disclaimers

  • This monitor is no longer useful as the cafeteria has returned to normal use!
  • I have not maintained the DUO login funcionality, so if you are looking for a bot that can log into DUO this repo's code may not work anymore as they frequently change stuff
  • The reverse engineering of the DUO login flow is purely for webscraping and educational purposes. Do NOT use this login code for any malicious purposes. It would be pointless to even try and do so considering it still requires the manual app 2FA of whichever user has their info input into the bot!
  • There is no private information in here at all. All URLs for the API endpoints are publicly available in the Javascript code of DUO and on the CBORD login page (I just grabbed them from Chrome DevTools network logging), so there's no funny business here! All this bot did was login to CBORD, I authorized the DUO login from my phone, and it sent a Discord/SMS message to me when I could order food!

Why I did this

  • I could've just set reminders to tell me to order food because the time slots went live almost always at the same time, but I wanted to make this bot to post publicly eventually
  • All of the work I do for bots like Akari is always paid and the code is not available to be published publicly, but I wanted to really quickly throw together an example bot as a lot of the methods for putting together request payloads, parsing from the page, logging in, etc. is very similar to the exact stuff in the bots I work on
  • In the same vein as the last bulletpoint, the only difference between this bot and the private bot I work for is what websites it's designed to work on, the real bot I work on has a frontend to control it over GRPC, and this bot also runs single-threaded but if you wanted to run a bunch of "tasks" you could just use Goroutines and make it multithreaded!
  • Another difference is the info required for each task. For this bot, the relevant data is the login info, Discord Webhook URL, etc. But, a typical shoe-bot or retail-bot task would need stuff like payment info, shipping address, email, etc.
Similar Resources

Simple online syncing tool for Oracle Object Store

TrollBox ... use your storage with Oracle Object Store Quick Start Make sure you have the Object Storage, bucket and you know the compartment id where

Oct 25, 2021

GoScanPlayers - Hypixel online player tracker. Runs as an executable and can notify a Discord Webhook

GoScanPlayers - Hypixel online player tracker. Runs as an executable and can notify a Discord Webhook

GoScanPlayers Hypixel online player tracker. Runs as an executable and can notif

Oct 16, 2022

A high performance online bookstore system.

HPOB 高性能网上书店 A high performance online bookstore system. Introduction 介绍 一个基于Gin、gorm、viper、zap等库的web服务器,实现了网上书店相关接口。 Summary 概要 使用go语言编写的,基于gin、gorm、

Apr 27, 2022

Asynchronously control the different roles available in the kubernetes cluster

RBAC audit Introduction This tool allows you to asynchronously control the different roles available in the kubernetes cluster. These audits are enter

Oct 19, 2021

A set of components that can be composed into a highly available metric system with unlimited storage capacity

A set of components that can be composed into a highly available metric system with unlimited storage capacity

Overview Thanos is a set of components that can be composed into a highly available metric system with unlimited storage capacity, which can be added

Oct 20, 2021

PolarDB Stack is a DBaaS implementation for PolarDB-for-Postgres, as an operator creates and manages PolarDB/PostgreSQL clusters running in Kubernetes. It provides re-construct, failover swtich-over, scale up/out, high-available capabilities for each clusters.

PolarDB Stack is a DBaaS implementation for PolarDB-for-Postgres, as an operator creates and manages PolarDB/PostgreSQL clusters running in Kubernetes. It provides re-construct, failover swtich-over, scale up/out, high-available capabilities for each clusters.

PolarDB Stack开源版生命周期 1 系统概述 PolarDB是阿里云自研的云原生关系型数据库,采用了基于Shared-Storage的存储计算分离架构。数据库由传统的Share-Nothing,转变成了Shared-Storage架构。由原来的N份计算+N份存储,转变成了N份计算+1份存储

Nov 8, 2022

OCI drive, available from home

OCI Drive ... use your storage with Oracle Object Store Quick Start Make sure you have the Object Storage, bucket and you know the compartment id wher

Nov 10, 2021

Grafana Mimir provides horizontally scalable, highly available, multi-tenant, long-term storage for Prometheus.

Grafana Mimir provides horizontally scalable, highly available, multi-tenant, long-term storage for Prometheus.

Grafana Mimir Grafana Mimir is an open source software project that provides a scalable long-term storage for Prometheus. Some of the core strengths o

Jan 3, 2023

Dgraph Backup and Restore (cloud). Read-only mirror.

dgbrx Dgraph Backup and Restore X dgbrx is a Go commandline tool which helps to do a backup, restore or clean on a Dgraph Cloud (aka slash / managed)

Oct 28, 2021
Testcontainers is a Golang library that providing a friendly API to run Docker container. It is designed to create runtime environment to use during your automatic tests.

When I was working on a Zipkin PR I discovered a nice Java library called Testcontainers. It provides an easy and clean API over the go docker sdk to

Jan 7, 2023
Savoir - A tool to perform tasks during internal security assessment

Savoir Savoir is a tool to perform tasks during internal security assessment. Th

Nov 9, 2022
Operator Permissions Advisor is a CLI tool that will take a catalog image and statically parse it to determine what permissions an Operator will request of OLM during an install

Operator Permissions Advisor is a CLI tool that will take a catalog image and statically parse it to determine what permissions an Operator will request of OLM during an install. The permissions are aggregated from the following sources:

Apr 22, 2022
General Pod Autoscaler(GPA) is a extension for K8s HPA, which can be used not only for serving, also for game.
General Pod Autoscaler(GPA) is a extension for K8s HPA, which can be used not only for serving, also for game.

Introduction General Pod Autoscaler(GPA) is a extension for K8s HPA, which can be used not only for serving, also for game. Features Compatible with a

Aug 19, 2022
A distributed append only commit log used for quick writes and reads to any scale
A distributed append only commit log used for quick writes and reads to any scale

Maestro-DB A distributed append only commit log used for quick writes and reads to any scale Part 1 - Scaffolding Part-1 Notes Going to start off with

Nov 28, 2021
I'd like to share random apps in the spare times. Thus, I'm going to try learning some concepts of Go and as much as I can I try to clarify each line.

go-samples I'd like to share random apps in the spare times. Thus, I'm going to try learning some concepts of Go and as much as I can I try to clarify

Mar 16, 2022
Godart - Amazon Alexa skill in Go to read train times out loud

GODART Alexa skill to have DART times for the requested station. build and deplo

Apr 13, 2022
Output all versions of a local git repo, which could be used as test data for your ML program.

gitwalker Output all versions of a local git repo, which could be used as test data for your ML program. Notice This program is under development. Cur

Dec 27, 2021
A simple tool who pulls data from Online.net API and parse them to a Prometheus format

Dedibox backup monitoring A simple tool who reads API from Online.net and parse them into a Prometheus-compatible format. Conceived to be lightweight,

Aug 16, 2022