This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| setlocal EnableExtensions EnableDelayedExpansion | |
| rem Pokemon card cropper for Windows. | |
| rem Usage: | |
| rem 1. Drag image files or folders onto this .bat | |
| rem 2. Or put this .bat in a folder with images and double-click it | |
| rem | |
| rem Cropped PNGs are written to a "cropped" folder next to this .bat. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on run {input, parameters} | |
| tell application "System Events" | |
| set frontApp to name of first application process whose frontmost is true | |
| end tell | |
| if frontApp is not "Google Chrome" and frontApp is not "Safari" then | |
| return input | |
| end if | |
| set theURL to "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function importDeckString(deckString) { | |
| var lines = deckString.trim().split('\n'); | |
| lines = lines.filter(item => item !== ""); | |
| lines.pop() | |
| const cards = []; | |
| var numOfPokemon = 0 | |
| var numOfTrainers = 0 | |
| var numOfEnergy = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| import requests | |
| import bs4 | |
| import json | |
| if len(sys.argv) < 2: | |
| print("Please provide a URL as input") | |
| sys.exit(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| baseURL = 'https://www.pokemon-card.com' | |
| def parseSoup(soup): | |
| topHeadings = soup.find_all('h2') | |
| leftBox = soup.find(class_='LeftBox') | |
| rightBox = soup.find(class_='RightBox') | |
| topInfo = soup.find(class_='TopInfo') | |
| atr = { | |
| 'name':'', | |
| 'cardClass': '', # "ポケモン, Trainer, エネルギー" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let main = document.getElementById('genesis-content') | |
| let headings = main.getElementsByClassName('headings')[0] | |
| let headingText = Array.from(headings.children).map(el=>el.innerText.split(":")[0].replace("\n","")).join(',') | |
| let article = Array.from(main.getElementsByTagName('article')) | |
| let rowTextArray = article.map(el=>{ | |
| let columns = Array.from(el.getElementsByClassName('column')) | |
| return columns.map(el=>el.innerText.replace('\n',"")).join(',') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| columns = list(df.columns) | |
| df = df[[columns[i] for i in [3,2,1,4,6,4,8]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let connectors = figma.currentPage.children.filter(layer=>layer.type=="CONNECTOR") | |
| connectors.forEach(layer=>{layer.visible = false}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let selection = figma.currentPage.selection[0] | |
| let paddingWidth = selection.paddingLeft + selection.paddingRight | |
| let insetWidth = selection.width - paddingWidth | |
| let times = [60*10+10,60*10+22,60*12+42,60*13+59] | |
| // Remove extra children | |
| selection.children.forEach((e,i)=>{ | |
| if (i>0) { | |
| e.remove() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let selection = figma.currentPage.selection | |
| let width = selection[0].width | |
| let height = selection[0].height | |
| let multiplier = Math.floor(width/16) | |
| selection[0].resize(16*multiplier,9*multiplier) | |
| selection[0].constrainProportions = true |
NewerOlder