freelawproject / foresight

Where we discuss and prioritize new features
2 stars 1 forks source link

Add webhook event for new RECAP documents #48

Open mlissner opened 1 year ago

mlissner commented 1 year ago

I noticed while working on the Zapier integration that it'd be really nice to get a webhook event when a document became available for a filing. I think we'd send this event to folks that were subscribed to particular cases.

I could imagine somebody that would want to know whenever there was a new document available, but we can deal with that use case later.

mlissner commented 1 year ago

Randomly, I came across a Slack message from @johnhawkinson about this from a few years ago today. He wanted to get alerts as a user whenever docs became available in a case.

mlissner commented 1 year ago

Another use-case here is that BCB currently waits 120 seconds between when it learns about a new filing and when it sends a tweet. The reason for the delay is to wait and see if a document becomes available. If we had this webhook, we could intercept that delay (somehow; I have no idea how to stop a task in rq?), and then send the tweet immediately.

A user reports that faster tweets would be nice because it'd allow:

  1. RT'ing the bot when there's breaking news, instead of just sending out the doc themselves.
  2. Faster reactions when things might be market-moving info.
  3. Probably other stuff that are more of a feeling than something concrete.
weedySeaDragon commented 1 year ago

FYI - you can stop a running job and cancel a job in RQ.

The tests in django_rq/tests/test_views.py show how.