I started to experiment with Web Monetization Reciever this past week and came up with an idea for which I just had to crank out a prototype. Thankfully I was able to make it work (I think). You can find the app here (the server may be sleeping so give it a moment to wake up).
Basically, I use a Bucket Server (a server that creates buckets using the Monetizer API) to collect in one bucket all of the funds streamed to the app over the course of the week. And a Revshare Server to create a Revshare Payment Pointer taking as arguments the pointer and payout details for the winner(s).
Every week, the app sends a request to the Revshare Server to update the Revshare Payment Pointer and sends a request to the Bucket Server to send whatever has accumulated in the bucket to the Revshare Payment Pointer. Technically what happens is that the app calls .spend() which subtracts the specified funds from the bucket and if successful, .pay() which should send the specified funds to the Revshare Payment Pointer.
I haven’t had a chance to test just yet. A lot of it was built on what I believed would be the expected behavior. If you want to try it out, please let me know! It would be great to get a few testers. I’ll commit the Revshare Server (or, if I should, a pull request) and the Bucket Server as well as document when I have some time to do so.