Jump to content

Posting deck with link to Pokémon database


PinkyPockyPanda
 Share

Recommended Posts

I wrote a Java code to automatically add a link to card database. 

 

From this

Spoiler

##Pokémon - 6

* 1 Aerodactyl TEU 130
* 4 Zacian V PR-SW 18
* 1 Bastiodon UPR 85

##Trainer Cards - 39

* 1 Gladion CIN 109
* 4 Metal Saucer SSH 170
* 2 Rusted Sword SHF 62
* 1 Rescue Stretcher GRI 130
* 1 Bird Keeper DAA 159
* 1 Ultra Ball DEX 102
* 1 Rare Candy PRC 135
* 2 Unidentified Fossil TEU 155
* 1 Professor's Letter BKT 146
* 2 Skyla RCL 166
* 1 Chaotic Swell CEC 187
* 1 Nest Ball SUM 123
* 2 Pokédex BLW 98
* 1 Escape Rope PRC 127
* 1 Battle Compressor Team Flare Gear PHF 92
* 1 Teammates PRC 141
* 1 Clay CEC 188
* 2 Boss's Orders SHF 58
* 1 Float Stone PLF 99
* 1 Guzma & Hala CEC 193
* 1 Pokémon Ranger STS 104
* 1 Great Catcher CEC 192
* 1 Lillie's Poké Doll CEC 197
* 1 Muscle Band XY 121
* 1 Dowsing Machine PLS 128
* 1 VS Seeker PHF 109
* 2 Professor Kukui SUM 128
* 1 Target Whistle Team Flare Gear PHF 106
* 2 Switch BLW 104

##Energy - 15

* 2 Coating {M} Energy VIV 163
* 11 Metal Energy SMEnergy 17
* 1 Double Colorless Energy FCO 114
* 1 Triple Acceleration Energy UNB 190

Total Cards - 60

 

To this

Spoiler

##Pokémon - 6

* 1 Aerodactyl TEU 130     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm9/130/ >
* 4 Zacian V PR-SW 18     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/ss-series/swshp/18/ >
* 1 Bastiodon UPR 85     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm5/85/ >

##Trainer Cards - 39

* 1 Gladion CIN 109     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm4/109/ >
* 4 Metal Saucer SSH 170     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/ss-series/swsh1/170/ >
* 2 Rusted Sword SHF 62     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/ss-series/swsh45/62/ >
* 1 Rescue Stretcher GRI 130     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm2/130/ >
* 1 Bird Keeper DAA 159     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/ss-series/swsh3/159/ >
* 1 Ultra Ball DEX 102     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/bw-series/bw5/102/ >
* 1 Rare Candy PRC 135     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/xy-series/xy5/135/ >
* 2 Unidentified Fossil TEU 155     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm9/155/ >
* 1 Professor's Letter BKT 146     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/xy-series/xy8/146/ >
* 2 Skyla RCL 166     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/ss-series/swsh2/166/ >
* 1 Chaotic Swell CEC 187     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm12/187/ >
* 1 Nest Ball SUM 123     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm1/123/ >
* 2 Pokédex BLW 98     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/bw-series/bw1/98/ >
* 1 Escape Rope PRC 127     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/xy-series/xy5/127/ >
* 1 Battle Compressor Team Flare Gear PHF 92     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/xy-series/xy4/92/ >
* 1 Teammates PRC 141     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/xy-series/xy5/141/ >
* 1 Clay CEC 188     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm12/188/ >
* 2 Boss's Orders SHF 58     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/ss-series/swsh45/58/ >
* 1 Float Stone PLF 99     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/bw-series/bw9/99/ >
* 1 Guzma & Hala CEC 193     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm12/193/ >
* 1 Pokémon Ranger STS 104     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/xy-series/xy11/104/ >
* 1 Great Catcher CEC 192     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm12/192/ >
* 1 Lillie's Poké Doll CEC 197     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm12/197/ >
* 1 Muscle Band XY 121     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/xy-series/xy1/121/ >
* 1 Dowsing Machine PLS 128     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/bw-series/bw8/128/ >
* 1 VS Seeker PHF 109     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/xy-series/xy4/109/ >
* 2 Professor Kukui SUM 128     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm1/128/ >
* 1 Target Whistle Team Flare Gear PHF 106     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/xy-series/xy4/106/ >
* 2 Switch BLW 104     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/bw-series/bw1/104/ >

##Energy - 15

* 2 Coating {M} Energy VIV 163     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/ss-series/swsh4/163/ >
* 11 Metal Energy SMEnergy 17
* 1 Double Colorless Energy FCO 114     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/xy-series/xy10/114/ >
* 1 Triple Acceleration Energy UNB 190     < https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/sm-series/sm10/190/ >

Total Cards - 60
 

 

I did try to make the link shorter but cannot find the way to make it a link text without using forum link button, (try common forum tag, but did not work). Any suggestion are welcome.

 

Also, not sure if I were allowed to share the app by upload it to free download site, considered Hacking or Trojan issue. So instead, I post my code here allow it to be able to confirm that no suspicious code hidden within. It was written in java, the code is very simple, anyone with knowledge can compile and use it. Modify it to other language should be easy too. And I had hope that Mod would integrate it into the forum feature for easy to use by anyone and with better text style ^_^

 

code

Spoiler

import java.util.Properties;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

class PokemonDeckLink extends JFrame
{
    public PokemonDeckLink()
    {
        setTitle("Pokemon Deck Link v0.0");
        setSize(1000,700);
        setVisible(true);

        createContentPane();
                
        createContentPane();
        setContentPane(contentPane);
            
        addWindowListener(new WindowAdapter()
        {  public void windowClosing(WindowEvent e)
            {
                System.exit(0);
            }
        });
                    
        show();        
    }
    
    public static void main(String[] args)
    {
        PokemonDeckLink pdl = new PokemonDeckLink();
        
    } // end of main    
    
    //
    //
    //
    JToolBar toolBar;
    JPanel contentPane = new JPanel();
    JPanel mainPanel = new JPanel();
    JPanel inputPanel = new JPanel();
    JTextArea inputArea = new JTextArea(30,80);
    JPanel outputPanel = new JPanel();
    JTextArea outputArea = new JTextArea(30,80);
    
    private void createContentPane()
    {
        createToolBar();
        createPanel();
        
        contentPane.setLayout(new BorderLayout(5,5));
        contentPane.add(toolBar, BorderLayout.PAGE_START);         
        contentPane.add(mainPanel, BorderLayout.CENTER); 
    }
        
    private void createToolBar()
    {    
        toolBar = new JToolBar();
        
        toolBar.setLayout(new FlowLayout(FlowLayout.LEFT));
        
        ActionListener processButtonListener = new ActionListener() {
            public void actionPerformed(ActionEvent e)
            {
                process();
            }
        };
        JButton processButton = new JButton("PROCESS");
        processButton.addActionListener(processButtonListener);
        toolBar.add(processButton);

    }    
    
    public void createPanel()
    {
        JScrollPane inScrollPane = new JScrollPane(inputArea);
        inputPanel.add(inScrollPane);
        
        JScrollPane outScrollPane = new JScrollPane(outputArea);
        outputPanel.add(outScrollPane);
        
        JTabbedPane tabbedPane = new JTabbedPane();
        tabbedPane.addTab("Input", inputPanel);
        tabbedPane.addTab("Output", outputPanel);
        tabbedPane.setSize(1000,700);

        mainPanel.setSize(1000,700);
        mainPanel.add(tabbedPane);        
    }
    
    //
    //
    
    public void process()
    {
        for (String line : inputArea.getText().split("\\n"))
        {
            outputArea.append(line);
            
            try
            {
                String[] s = line.split(" ");
                
                String num = s[s.length-1];
                String set = s[s.length-2];
                
                String[] code = getCode(set);
                
                if (code!=null)
                {
                    String link="< https://www.pokemon.com/us/pokemon-tcg/pokemon-cards/"+code[0]+"/"+code[1]+"/"+num+"/ >";
                    outputArea.append("     "+link);
                }
            }
            catch(Exception e) {}
            
            outputArea.append("\n");
            
        }
    }
    
    public String[] getCode(String set)
    {
        
        for(int n=0;n<SET.length;n++)
        {
            if(set.equals(SET[n][0]))
            {
                String[] code=new String[2];
                code[0]=SET[n][2];
                code[1]=SET[n][1];
                
                return code;
            }
        }
        
        return null;
    }
    
    String[][] SET = {
        // Sword & Shield
        {"BST", "swsh5", "ss-series"},
        {"SHF", "swsh45", "ss-series"},
        {"VIV", "swsh4", "ss-series"},
        {"CPA", "swsh35", "ss-series"},
        //{"FUT20", "", "ss-series"},
        {"DAA", "swsh3", "ss-series"},
        {"RCL", "swsh2", "ss-series"},
        {"SSH", "swsh1", "ss-series"},
        //{"SSEnergy", "", "ss-series"},
        {"PR-SW", "swshp", "ss-series"},
        
        // Sun & Moon
        {"CEC", "sm12", "sm-series"},
        //{"MCD19", "", "sm-series"},
        {"HIF", "sm115", "sm-series"},
        {"UNM", "sm11", "sm-series"},
        {"UNB", "sm10", "sm-series"},
        {"DET", "det", "sm-series"},
        {"TEU", "sm9", "sm-series"},
        {"LOT", "sm8", "sm-series"},
        {"DRM", "sm75", "sm-series"},
        {"CES", "sm7", "sm-series"},
        {"FLI", "sm6", "sm-series"},
        {"UPR", "sm5", "sm-series"},
        {"CIN", "sm4", "sm-series"},
        {"SLG", "sm35", "sm-series"},
        {"BUS", "sm3", "sm-series"},
        {"GRI", "sm2", "sm-series"},
        //{"TK10L", "", "sm-series"},
        //{"TK10A", "", "sm-series"},
        {"SUM", "sm1", "sm-series"},
        {"PR-SM", "smp", "sm-series"},
        
        // XY
        {"EVO", "xy12", "xy-series"},
        //{"MCD16", "", "xy-series"},
        {"STS", "xy11", "xy-series"},
        {"FCO", "xy10", "xy-series"},
        //{"TK9S", "", "xy-series"},
        //{"TK9P", "", "xy-series"},
        {"GEN", "g1", "xy-series"},
        {"BKP", "xy9", "xy-series"},
        {"BKT", "xy8", "xy-series"},
        {"AOR", "xy7", "xy-series"},
        {"ROS", "xy6", "xy-series"},
        //{"TK8O", "", "xy-series"},
        //{"TK8A", "", "xy-series"},
        {"DCR", "dc1", "xy-series"},
        {"PRC", "xy5", "xy-series"},
        {"PHF", "xy4", "xy-series"},
        {"FFI", "xy3", "xy-series"},
        {"FLF", "xy2", "xy-series"},
        //{"TK6S", "", "xy-series"},
        //{"TK6N", "", "xy-series"},
        {"XY", "xy1", "xy-series"},
        {"KSS", "xy0", "xy-series"},
        {"PR-XY", "xyp", "xy-series"},
        
        // Black & White
        {"LTR", "bw11", "bw-series"},
        {"PLB", "bw10", "bw-series"},
        {"PLF", "bw9", "bw-series"},
        {"PLS", "bw8", "bw-series"},
        {"BCR", "bw7", "bw-series"},
        {"DRV", "dv1", "bw-series"},
        {"DRX", "bw6", "bw-series"},
        //{"MCD", "", "bw-series"},
        {"DEX", "bw5", "bw-series"},
        {"NXD", "bw4", "bw-series"},
        {"NVI", "bw3", "bw-series"},
        //{"TK5Z", "", "bw-series"},
        //{"TK5E", "", "bw-series"},
        {"EPO", "bw2", "bw-series"},
        //{"MCD11", "", "bw-series"},
        {"BLW", "bw1", "bw-series"},
        {"PR-BLW", "bwp", "bw-series"},
        
        // HeartGold & SoulSilver
        {"CL", "col", "hs-series"},
        ****", "hgss4", "hs-series"},
        {"UD", "hgss3", "hs-series"},
        ****", "hgss2", "hs-series"},
        //{"TK4R", "", "hs-series"},
        //{"TK4G", "", "hs-series"},
        {"HS", "hgss1", "hs-series"},
        
        
    };
    
    
}

 

  • Upvote 1
Link to comment
Share on other sites

Some set like the promo one have the issue with card number, but I am not going to fix that right now. Sorry 😛

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...