User talk:BryghtShadow

I want this Forum to be Highlighted
It's about the new item layout that has been hanging around 's page for so long. It has been months, and nothing has happen, so I think I should get people's attention on it and get it worked out.

The link is: http://leagueoflegends.wikia.com/wiki/Thread:931453

ClariS (talk) 05:45, March 19, 2013 (UTC)

Have a userbox
01:33, April 5, 2013 (UTC)

Mineko Charat Lucky message wall
Prettified prototype list of Special:PrefixIndex/Thread:Mineko Charat Lucky.

Double Redirects and Templates
Special:DoubleRedirects and Special:UncategorizedTemplates

I request that you correct any double redirects you made, and document/categorize effectively any templates you have created. Our situation with templates has two categories right now: established long-used templates, and relatively new templates mainly created by a single user with no documentation or category to indicate its function. I hope that you can help to improve this area of the wiki. 19:48, April 18, 2013 (UTC)
 * Document your damn templates >_> 02:59, April 27, 2013 (UTC)
 * I'm in the process of it. &mdash;BryghtShadow 03:03, April 27, 2013 (UTC)
 * While we're at it, you should document and categorise your templates, too. See: Mv2 ([ history] | backlinks) &mdash;BryghtShadow 05:44, April 27, 2013 (UTC)

Templatey stuff
What's the point of Category:Template documentation pages? Why not transclude Category:Template documentation to all /doc's? 02:01, May 11, 2013 (UTC)
 * Altered []. &mdash;BryghtShadow 15:28, May 11, 2013 (UTC)

Third message from me in a row
Hi. >_> So I changed all the champions by price categories to _champion, but they need to be purged on each page (manually). Before that, though, the advanced attributes categories have to be replaced, but I'm not sure how to change the functionality of Champion_info to use _champion categories. Halp. 01:51, May 20, 2013 (UTC)
 * (Obligatory response). . All champs have been touched. &mdash;BryghtShadow 03:08, May 20, 2013 (UTC)

Number four
Bry was a derp 02:31, May 29, 2013 (UTC)
 * OH DERP D: --BryghtShadow 08:20, May 29, 2013 (UTC)

Request Bot Status for Remmii_Bot
Hey Bryght, I talked to you last week about some data scraping I want to do on a nightly basis as a backend for an app I'm working on. You gave me a few pointers and we were both under the impression that I was no longer running up against any API limits, however I noticed when actually parsing the data that I was still getting a warning that I couldn't supply more than 50 titles. I then proceeded to apply for bot status via Wikia and found out that I need to have public approval in order to be granted bot status.

Would you consider giving me approval for my other account (User:Remmii_Bot ) to receive bot status so that I can overcome the api limits I'm running up against? This would be a purely read bot, not a write one.

Thanks for your time,

Ryan

Remmii (talk) 15:51, June 18, 2013 (UTC)


 * What query are you trying? You're not doing something like are you? --BryghtShadow 02:45, June 19, 2013 (UTC)
 * Yes actually, except I guess I was trying to use JSON again. What you typed defaults to XML and does appear to grab them all. I'll try to work with XML and let you know if I run up against anything else. Thanks again for your help! Remmii (talk) 03:21, June 19, 2013 (UTC)
 * Bot rights -> Special:Contact Wikia for bot flag. Admins/crats can't give you the flag. 03:38, June 19, 2013 (UTC)
 * If you want JSON, then slap format=json on to the query~ i.e. --BryghtShadow 03:44, June 19, 2013 (UTC)
 * Still trying to guess what exact API request you are doing. This parse request returns a timeout error, and that's 50 titles:

mw.loader.using( 'mediawiki.api', function {   var api = new mw.Api;   api.get( { action: 'query', prop: 'revisions', rvprop: 'content', rvparse: , generator: 'categorymembers', gcmtitle: 'Category:Released_champion', gcmlimit: '50', format: 'json' } )  .done( function ( data ) { console.log( 'API result:', data ); } )  .fail( function ( error ) { console.log( 'API failed :(', error );  } ); });
 * --BryghtShadow 04:27, June 19, 2013 (UTC)
 * BryghtShadow: I'm running up against the limit again no matter which format I request it in. I feel like with the flag, at least my results would be consistent.
 * TehAnonymous: Yes, I did request rights through Wikia using the Special:Contact form. Their response was that I need to receive public approval from either the community or an admin of the League of Legends Wiki. I am supposed to contact them when/if I receive said approval.
 * Remmii (talk) 15:22, June 19, 2013 (UTC)
 * (adjusted formatting) I don't mind bot approval, but I have questions...:
 * 1. What exact query are you doing?
 * 2. What is its intended purpose, that is, what info are you attempting to obtain?
 * 3. Have you considered continuing queries? Because if you aren't doing so, suppose your limit gets bumped to 500 (or even 5000) and there are 10000 actual results?
 * I'm still wondering "What query are you trying". Surely your project isn't so closed-source to part with such details? --BryghtShadow 17:11, June 19, 2013 (UTC)
 * BryghtShadow: Sorry I think I've given you the wrong impression. The work I'm doing isn't closed or secret, I'll post it on GitHub for you guys shortly so that you have an idea of what's going on. As for your questions:
 * 1.  http://leagueoflegends.wikia.com/api.php?action=query&prop=revisions&rvprop=content&generator=categorymembers&gcmtitle=Category:Released_champion&gcmlimit=max
 * 2. The purpose is to populate a database hosted by Parse.com in order to be the backend for an iOS app I'm working on. Parse does a lot of really cool things to streamline the way that apps interact with their servers. I plan to add some tags to different items in the database in order to support some automatically generated trivia questions, and I obviously don't want to interfere with the wiki by adding tags to it. This will also cause app traffic to hit the Parse database rather than the wiki. Currently, I am seeking to obtain Champion names/stats/etc as well as Abilities/Items. Triva format would be multiple choice where an answer is randomly selected, a tag that the answer belongs to is randomly selected, and then 3 other items with the same tag are selected as plausible alternative choices. I would also like to be able to show info about champs/abilities/items in a dictionary-esque format within the app. I feel like your wiki is an excellent resource and would help facilitate this type of app since no official API currently exists from Riot.
 * 3. I haven't read into them in depth, although just as an FYI I only have a 15 second window before a script initiated through Parse.com will time out. It may not be a huge hit to recieve, continue, receive, continue, but at the same time I don't anticipate running into those upper limits due to the nature of the game. I feel like 500 champions or items would become rather overwhelming from a gameplay perspective and discourage summoners new to the game.
 * Like I said, I'll post my Parse.com scripts on GitHub and link it to you shortly. I just feel a lot could be gained by increasing the limits since I could avoid the problem all together rather than code around them and edge closer to the end of my 15 second window. Sorry for wall of text Bryght! Remmii (talk) 18:40, June 19, 2013 (UTC)
 * Here's a link to the GitHub repo: https://github.com/RZulkoski/Parse.com-LoL-Wikia-Bot
 * It's pretty messy right now as it's still in the early stages, but I'm getting there. When it's all said and done it will basically check the Parse database, check the Wikia scrape, compare them, and then update/store new info as needed. In the short term I'll be running them many times a day, but in the long term it would be a nightly thing where they should each just run once. Remmii (talk) 20:08, June 19, 2013 (UTC)
 * Yay, code! Apologies if I came off as rude. I realised that the warning was all the way at the bottom of the page. Ugh. To work around that, I think exporting pages might just work: This query seems to be fine without any hiccups. You'll just need to parse a bit of XML.
 * fetchChampionListFromWikia If you're just wanting and, rather than parsing List of Champions  would it be easier to work with Template:CR_type ? I have plans to automate the champ list data; I just haven't gotten around to do so because of the extra information of permanent discounts. Once automated, the source will be void of data (see Base_champion_statistics).
 * fetchChampionDataFromWikiaForChampions Rather than parsing, would it be better to grab the source code? (Generators :D)
 * I hope this helps with the API limits. --BryghtShadow 01:44, June 20, 2013 (UTC)
 * No problem Bryght, you didn't come off as rude so much as I realized that I didn't make myself clear up to this point. I did just try adding &export to the end of the url and while it does fetch all the results, it is in XML like you said. This next part will blow your mind, Parse doesn't currently support any format except JSON. They also don't allow linking libraries when using Cloud Code (which I am), so unless I want to write my own XML parser, I'm stuck with JSON. If it's not too much trouble I'd really prefer to just have higher limits. If not I can try to work around it some more. Thanks! Remmii (talk) 03:50, June 20, 2013 (UTC)

(Outdenting) XML parsing is not that hard compared to parsing ill-formed HTML. Here are snippets: function getPageText(data) { var re = / [\s\S]*? ([\s\S]*?)<\/title>[\s\S]*?([\s\S]*?)<\/text>[\s\S]*?<\/page>/g, match, pages = {}; while (match = re.exec(data)) { pages[match[1]] = match[2]; }    return pages; } // Champion data $.getJSON('http://leagueoflegends.wikia.com/api.php?action=query&format=json&callback=?&export', {    generator: 'categorymembers',     gcmlimit: 'max',     gcmtitle: 'Category:Data_templates' }).done(function(data) {     console.log('API result:', data);     // undefined checks omitted for brevity     var text = data.query.export['*'];     var result = getPageText(text);     console.log('Data templates for champion data:', result); }).fail(function(error) {     console.log('API failed:', error); }); // Champion pages (Ability) $.getJSON('http://leagueoflegends.wikia.com/api.php?action=query&format=json&callback=?&export', {    generator: 'categorymembers',     gcmlimit: 'max',     gcmtitle: 'Category:Released_champion' }).done(function(data) {     console.log('API result:', data);     // undefined checks omitted for brevity     var text = data.query.export['*'];     var result = getPageText(text);     console.log('Released champion for abilities:', result); }).fail(function(error) {     console.log('API failed:', error); }); --BryghtShadow 05:47, June 20, 2013 (UTC)

Bryght, your suggestion to parse the XML using the export parameter is spot on. This appears to meet my needs for the project and I withdraw my request for bot status. Thanks for all of your help and patience! =) Remmii (talk) 20:05, June 20, 2013 (UTC)