Yesterday Alec Flett suggested using the API to make a list of television spin-off shows using the API and MJT.
Here’s the hand-written page on the Wikipedia: List of television spin-offs
Here’s my auto-generated list. (Freebase account required). It’s the first time I’ve written anything using MJT. Feedback very welcome.
Here’s a screen-shot to prove that it works 😉
How the code works:
- Execute a query for all TV Programs with Spin-offs
- Create a hash-table of programs that are spin-offs
- Display all the root TV programs
- Display all the spin-off TV programs
- For-each spin-off, move its DOM element to be a child of its parent TV program
The program also highlights the 30-odd TV Programs with claim to be spin-offs of themselves. Looks like the data could do with some cleaning up.
Bugs to fix:
- Internet Explorer support (currently only works in Firefox)
- Alphabetically sort sub-branches of tree as well
- Stop using Wikipedia CSS file
Updates: Nov 07 – fixed broken link