User blog:JoshuaJSlone/Oricon Chart Positions templates

Hey guys. In an edit today Pyo-Kiyo mentioned the possibility of a template for Oricon charts. Working with that code has always been ugly, and I'd wondered before if some sort of template would help, but I wasn't sure quite how to go about it. Hearing someone else bring it up independently is a good reason to bring it off the backburner, so I decided to give it a try. I've got some results, but I'm definitely ready for any suggestions to make it nicer if you've got any--the pure amount of data in these charts means it's always going to be a bit ugly and unwieldy in code, I'm afraid.

Anyway, I was thinking that while a template for an entire chart would be difficult, one for a single week would be manageable, and then it could be used again for the second week and so on. I then made a few more templates to go before and after, for the regular table code. Right now since these are all in testing form their names start with Sandbox.

and are the bookends. Not that it makes a big difference, but I'm not sure whether to go with start/finish, begin/end, open/close, or many other naming possibilities.

is for messages like "out for 1 week". In that case you'd use

is by far the most important and complicated one. If you've got a better way to do this I'm all ears, but for now I've got it set up so the days (plus the weekly total) are all separated by commas, and in any section the rank and actual sales numbers are separated by a slash. It's very picky about always having enough commas for the full row, or it returns an error.

As my test case I recreated the table from Hadaka no Hadaka no Hadaka no KISS / Are Kore Shitai!.

creates

There are a few other advantages to this beyond not having to deal with table code. For one, it would allow us to easily modify the design of all charts using them. For another, it would make copying to interlanguage wikis a bit easier--they could modify the header titles in OriconStart once and it would apply to all tables.