-
Notifications
You must be signed in to change notification settings - Fork 15
feat: capital grains override #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Conversation
#190) * fix: coalesce intervals if gap is 1 min, and do wrap-around coalescing * fix: unparseable tokens should be ignored * chore: remove extraneous comment * fix: redo the merging algo
…to feat/time-overwrites
don't mind the commits... I made this branch off of at least the diff is fine. |
I pushed a temp commit to main for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR Eric! Looks good to me for now. We can convert this to SQL once the admin dashboard is further along
const timeInfo: ITimeRowAttributes = {}; | ||
|
||
for (const token of tokens) { | ||
for (const token of timeSlotStrings) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename token to a more intuitive name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change tokens to be clearer.
} | ||
} catch (err: any) { | ||
notifySlack( | ||
`<!channel> Failed to parse token \`${token}\` from list of tokens \`${tokens}\`\n${err.stack}` | ||
`<!channel> Failed to parse token \`${token}\` from time slot \`${timeSlotStrings.join( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
@@ -20,7 +22,20 @@ export async function getHTMLResponse( | |||
url: url.toString(), | |||
}); | |||
|
|||
return response.data; | |||
const attemptedParsedDate = DateTime.fromRFC2822( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular reason for this over ISO 8601 or RFC 3339?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd wait for Jaisal's approval.
const timeInfo: ITimeRowAttributes = {}; | ||
|
||
for (const token of tokens) { | ||
for (const token of timeSlotStrings) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change tokens to be clearer.
"8/30/2025": ["CLOSED"], | ||
"8/31/2025": ["CLOSED"], | ||
"9/1/2025": ["CLOSED"], | ||
"9/2/2025": ["CLOSED"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There has got to be a more concise way to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol usually you would override a single day, I think
if (env.IN_TEST_MODE) { | ||
console.log("would've notified slack with message", message); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you clarify anywhere that this exists (test mode/this effect)? Maybe in readme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IN_TEST_MODE is set when tests are run (see package.json
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I figured it could also be used to allow us to stop spamming slack bot playground channel too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
Date
response header when scraping the Dining website. We do so to get the current year, since that's not included in the HTML itself. And yes, we can find the year locally, but using the response header date means that we know for sure the HTML corresponds to the date. May be a bit overkill now that I'm thinking about it, but it doesn't hurt)Example of how we can overwrite times: