Any enhancements you want me to add? Bugs to kill? I'm itching to touch some code so I may fix up some stuff along the way.
Any enhancements you want me to add? Bugs to kill? I'm itching to touch some code so I may fix up some stuff along the way.
Well I wouldn't say its impossible but it requires alot of tweaking and testing on the fly that might screw stuff up. Then there's Wikia's imposed user limits which farther hinders the possible approaches to take. I do have a rough plan on how to do it:
1) Use jQuery to load, parse and cache all pages that belong to a specific category by querying against Wikia API. How this is done can be through a list filterable by card rarity for starters. User picks e.g R+, then the jQuery backend calls the Wikia API for all page names WHERE the page in question belongs to R+. All these happen in real time, when the user hits the "Search". Then, the raw data is parsed here which brings us to the next step.
2) Once we have the list of pages, it's a trivial matter to just {{Arthur - Tech|SLvMax}} or something similar to retrieve the value from the iterated page, and inject new rows into the page for each result, neatly formatted, doable by LUA or purely jQuery.
3) ???
4) PROFIT!
So here comes the problem, jQuery is the main gear in this approach. Without it, you (I, for the most part) can't do much really. The other option is DPL (DynamicPageLists). However this requires another request to be put through to the Wikia team, and improper use can cause the site to run slow or crash, in the worst scenario. Also since I'm still serving, I don't know if I can finish up before having to go back into camp. My current schedule goes like, weekdays in, weekends out. ALSO, no promises. I stay away from web coding as its a convoluted piece of f*** up tech. Just a disclaimer :)))
As expected, they use jQuery to load their stuff. However, all their data is stored in huge lists which I'm not sure is bot-populated or by hand, either of which is unfeasible. E.g http://zh.kssma.wikia.com/wiki/Template:ListAssault and http://zh.kssma.wikia.com/wiki/Template:ListItem
http://zh.kssma.wikia.com/wiki/MediaWiki:Common.js <<<--- and without access (admin required) I can't do much there lul
My approach was to get all the pages belonging to a specific category like e.g Card, then pull the respective fields out and format into a table. Thus the use of the module I listed above, since that would do the scraping
Okay there *might* be a way to do it, however it requires another extension, http://www.mediawiki.org/wiki/Extension:DynamicPageListEngine, to be enabled. But of course, this is an expensive module to use (in terms of performance, server-wise).
However, it's the only feasible way I can think of that can condense everything within LUA. I don't want to dabble with jQuery as it's pretty painful to code in, just to load Wikia's own API: http://million-arthur.wikia.com/api.php?action=query&list=categorymembers&cmtitle=Category:Card&cmlimit=1000&format=json as an example, and then iterate + transform this into a table
Hmm, I might. Gotta read up on scraping wikia pages, but no guarantees since I don't really know how much Wikia might limit regarding the use of "web crawling" and stuff of the sort
Okay regarding that, I don't think positioning of the parameters matter when you're creating/editing a card. Iirc, the template attaches values to the specific key e.g "cost = 32" or "Lvmax = 60". Meaning, you can arrange the parameters however you like, the template feeds those to the module, then the module returns the formatted value out. So as a example, you can put your SLvMax right at the top followed by gender etc., and all should work fine. If it doesn't, then I'll have to take a look xD
PS: Hopefully I read your concern fine, please lmk if I misunderstood anything :)
Coding for flexibility (Y)
Hi, I changed the span to div already. Sorry for the late reply, just got out of camp today. Not too sure about the Lvmax/SLvmax bit though, which part is it? Top half or bottom half of the table?
Hi, I've begun recoding the main templates to make it cleaner and remove all the unsightly #if and #expr stuff. You can view and get the sources here:
Template:Detail (Original: Template:Detail - Modified: User:FZFalzar/Template:DetailPrototype)
Module:DetailMod - Module:DetailMod
Usage for modules:
It's pretty simple to use a module function. Just do #invoke: MyModuleName | MyFunction | MyParameter1 | MyParameter2 with the double braces as an example. You can refer to my prototype for reference, I have commented which parameters are required as well, inside the Module link.
If there are more pressing matters that you require abit of code for, just lmk, otherwise I'll just see where needs work and begin there
Regards,
Falzar
I do, I made an extractor for MA files, and yes it's direct from game cache after update
EDIT:
Do note that MLB stats are unavailable client-side, unless you can work out the mathematical formula behind MLB stat calculation. The farthest I've gotten is seeing the growth rate pattern as exponential (accelerating growth), linear and polynomial (decelerating growth), beyond that I have no idea.
This logo is nice, I was just trying to photoshop the original into a 250x65 lol, but I guess this works fine too :3