Skip to content

Instantly share code, notes, and snippets.

@sjwilliams
Last active February 15, 2018 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjwilliams/633cc133681c2a1771305b193c9aafa7 to your computer and use it in GitHub Desktop.
Save sjwilliams/633cc133681c2a1771305b193c9aafa7 to your computer and use it in GitHub Desktop.
Return BayPhoto print sizes as list of height/width ratios. Markup on the https://order.bayphoto.com page.
[].slice.call(document.querySelectorAll('#panel_content_4932_template li')).map(function(el){ return el.textContent.trim();}).filter(function(str){ return /^\S+x\S+$/.test(str) }).forEach(function(str){ var wh = str.split('x'); console.log(str, wh[1]/wh[0]) })
@sjwilliams
Copy link
Author

Outputs

3x3 1
3x4 1.3333333333333333
3x6 2
3.5x5 1.4285714285714286
4x4 1
4x5 1.25
4x6 1.5
4x8 2
4x12 3
5x5 1
5x7 1.4
5x10 2
5x15 3
5x20 4
5x30 6
5.5x8.5 1.5454545454545454
6x6 1
6x8 1.3333333333333333
6x9 1.5
6x12 2
6x18 3
6x24 4
7x7 1
7x9 1.2857142857142858
7x10 1.4285714285714286
7x11 1.5714285714285714
7x20 2.857142857142857
8x8 1
8x10 1.25
8x12 1.5
8x16 2
8x20 2.5
8x24 3
8x32 4
8.5x11 1.2941176470588236
9x12 1.3333333333333333
9x14 1.5555555555555556
9x24 2.6666666666666665
10x10 1
10x13 1.3
10x15 1.5
10x16 1.6
10x17 1.7
10x20 2
10x24 2.4
10x30 3
10x32 3.2
10x40 4
11x11 1
11x14 1.2727272727272727
11x16 1.4545454545454546
11x17 1.5454545454545454
11x22 2
11x28 2.5454545454545454
11x33 3
12x12 1
12x16 1.3333333333333333
12x17 1.4166666666666667
12x18 1.5
12x20 1.6666666666666667
12x24 2
12x30 2.5
12x36 3
12x48 4
13x19 1.4615384615384615
13x20 1.5384615384615385
14x14 1
14x20 1.4285714285714286
14x22 1.5714285714285714
14x26 1.8571428571428572
14x28 2
15x15 1
15x20 1.3333333333333333
15x24 1.6
15x30 2
16x16 1
16x20 1.25
16x24 1.5
16x30 1.875
16x32 2
16x48 3
16x64 4
18x24 1.3333333333333333
18x36 2
20x20 1
20x24 1.2
20x30 1.5
20x40 2
20x60 3
20x80 4
24x24 1
24x30 1.25
24x36 1.5
30x30 1
30x40 1.3333333333333333
30x45 1.5
30x50 1.6666666666666667
30x60 2
30x90 3
30x120 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment