A diagram combination extension
Posted: Fri Feb 17, 2012 2:28 pm
I have written some javascript that takes a bunch of ASCII diagrams and stiches them together into a single SGF. It tries to the do the "right thing" with variations and positions that may be reached from each other*, so that you can get a single game tree from all the diagrams for a Malkovitch game.
I've also written functions that suck up all the diagrams from an entire L19 thread, and one that sticks the resulting sgf into a new window as an eidogo player.
This is all wrapped up as a Chrome extension, is about ready to be released for use.
My question for the admins is about the load on the server. Every time it's invoked, the extension requests every page that's in the thread. Seems like that could be obnoxious.
So I could:
a) publicly release the extension in single page mode without the ability to suck up a whole thread.
b) release it, but tell people to behave by saving and posting the SGF when they use it.
c) just give it to admins/moderators or whatever,
d) investigate storing the data so that every time you visit a L19 thread, the extension passively stores the data it wants, and only requests pages when it needs to do so. This is probably the best long-term solution, but I don't know the relevant APIs. I'd like to learn them, but sometimes I'm a bit slow. It also requires somehow handling cases when you need to update data thanks to an edit to a pre-existing page.
* Right now, this works whether or not move numbers are used or are accurate, but doesn't work if there's a gap where multiple moves are added. That shouldn't be too hard to fix.
I forget exactly how it handles transpositions, but I know the answer is "not intelligently".
Those caveats make it a good time to mention that I'm a total amateur, I've been programming for less than two years, and this is my first project in javascript. Please, be gentle when you see this code. I know it's not very good.
I've also written functions that suck up all the diagrams from an entire L19 thread, and one that sticks the resulting sgf into a new window as an eidogo player.
This is all wrapped up as a Chrome extension, is about ready to be released for use.
My question for the admins is about the load on the server. Every time it's invoked, the extension requests every page that's in the thread. Seems like that could be obnoxious.
So I could:
a) publicly release the extension in single page mode without the ability to suck up a whole thread.
b) release it, but tell people to behave by saving and posting the SGF when they use it.
c) just give it to admins/moderators or whatever,
d) investigate storing the data so that every time you visit a L19 thread, the extension passively stores the data it wants, and only requests pages when it needs to do so. This is probably the best long-term solution, but I don't know the relevant APIs. I'd like to learn them, but sometimes I'm a bit slow. It also requires somehow handling cases when you need to update data thanks to an edit to a pre-existing page.
* Right now, this works whether or not move numbers are used or are accurate, but doesn't work if there's a gap where multiple moves are added. That shouldn't be too hard to fix.
I forget exactly how it handles transpositions, but I know the answer is "not intelligently".
Those caveats make it a good time to mention that I'm a total amateur, I've been programming for less than two years, and this is my first project in javascript. Please, be gentle when you see this code. I know it's not very good.