Page 1 of 1

New set Fate Reforged

PostPosted: 29 Dec 2014, 16:42
by fireshoes
I'll add the new cards to mtg-cards-data.

Re: New set Fate Reforged

PostPosted: 29 Dec 2014, 16:55
by LevelX
You can use this script (with Firefox or Opera) to get the spoiler text from http://www.mtgsalvation.com/spoilers/146-fate-reforged

Code: Select all
(function(){
   var x = '';
   function printCard(card){
       var text = '';
       text += card.name + '|Fate Reforged|';
       text += (card.number ? card.number : '') + '|';
       text += card.rarity + '|';
       text += card.cost + '|';
       text += card.type + '|';
       text += (card.pt ? card.pt.split('/').join("|") : '|') + '|';
       text += card.abilities + '|';
       return text;
   } 
   $.each($('div.t-spoiler-wrapper'), function(index, value) {
     var $value = $(value);
     var card = {};
     card.name = $value.find('div.t-spoiler').attr('id').replace(/Æ/g,"AE");     
     
     var findResult = $value.find('span.t-spoiler-artist').text();
     if(findResult.length > 0){
        var parts = findResult.split('#'); 
        card.number = parts[1].split('/')[0].trim();
     }
       
     var findResult = $value.find('span.t-spoiler-rarity').find('span:first').attr('class');
     if (findResult.substr(findResult.length - 8) == 'uncommon') {
       card.rarity = 'U';
     } else if (findResult.substr(findResult.length - 6) == 'common') {
       card.rarity = 'C';
     } else if (findResult.substr(findResult.length - 4) == 'rare') {
       card.rarity = 'R';
     } else if (findResult.substr(findResult.length - 6) == 'mythic') {
       card.rarity = 'M';
     } else if (findResult.substr(findResult.length - 4) == 'land') {
       card.rarity = 'L';
     } else {
       card.rarity = '?' + findResult;
     }
     
     var findCosts = $value.find('ul.t-spoiler-mana').find('span').text();     
     card.cost = '';
     $.each(findCosts , function (i, rowValue) {
             card.cost += '{' + rowValue + '}';
     });     

     card.type = $value.find('span.t-spoiler-type:first').text();
         
    card.pt = $value.find('span.t-spoiler-stat').text().replace(/\*/g,"0");

     var abilities = $value.find('div.t-spoiler-ability');
     abilities.find('span').replaceWith(function() { return '{' + this.innerHTML + '}' ; });
     
     card.abilities = '';
     $.each(abilities.find('p'), function (i, rowValue) {
       if (i > 0) {         
         card.abilities += '$';
       }
       // rowValue.find('span').replaceWith(function() { return '{' + this.innerHTML + '}' ; });
       //text = rowValue.innerHTML.replace(/(\r\n|\n|\r)/gm,"");
       card.abilities += rowValue.innerHTML.replace(/(\r\n|\n|\r)/gm,"").replace(/(<em>)/g,"<i>").replace(/(<\/em>)/g,"</i>");
     });         
     card.abilities = card.abilities.replace(/Æ/g,"AE").replace(/[\$]+/g,"$");
     
     x += printCard(card) + '\n';
   });   
   console.log(x);
   
})();   


Re: New set Fate Reforged

PostPosted: 30 Dec 2014, 16:19
by LevelX
I'm going next to cards with the new "Manifest" keyword.

Re: New set Fate Reforged

PostPosted: 02 Jan 2015, 12:07
by LevelX
I will implement missing green cards.

Re: New set Fate Reforged

PostPosted: 03 Jan 2015, 14:52
by LevelX
I will do some white cards.

Re: New set Fate Reforged

PostPosted: 13 Jan 2015, 08:16
by emerald000
Working on white cards for now.

Re: New set Fate Reforged

PostPosted: 14 Jan 2015, 04:10
by emerald000
Working on blue cards now.

(PS: The set finally arrived on Gatherer.)

Re: New set Fate Reforged

PostPosted: 14 Jan 2015, 05:57
by LevelX
Added the set to the card tracker.
Until Friday I'll be busy with other things.

Re: New set Fate Reforged

PostPosted: 15 Jan 2015, 01:34
by fireshoes
Any chance we can do an update before then to give people some playtime with the new set before the prerelease?

Re: New set Fate Reforged

PostPosted: 15 Jan 2015, 07:55
by LevelX
I can do a update this evening (probably before restart at 19:00 CET).