13
Recipe copy macro from alltheflavors => steam-engine
submitted about 4 years ago by nuketro0p3r

I made a small JavaScript macro that helps me copy recipes onto steam-engine.org for mixing.

Setup

1. Create new bookmark named "CopyRecipe". In the URL section, paste the following code

javascript: (function() {    function copyToClipboard(text) {        var dummy = document.createElement("textarea");        document.body.appendChild(dummy);        dummy.value = text;        dummy.select();        document.execCommand("copy");        document.body.removeChild(dummy);    }        var ingredients = document.getElementsByClassName('flavors')[0].children[0].children;        var results = [];    for(var i=0; i<ingredients.length-2; i++){        c = ingredients[i].children;        results.push(c[1].innerText + '|' + c[2].innerText + ' ' + c[3].innerText);    }    copyToClipboard(results);})();

2. Create new bookmark named "PasteRecipe". In the URL section, paste the following code

javascript: (function() {    var ingredients = window.prompt("Paste recipe");    var ingredients = ingredients.split(',');    var flavor_nm = document.getElementsByClassName('flavor-nm');    var flavor_percent = document.getElementsByClassName('flavor-percent');    for(var i=1; i<ingredients.length; i++) document.getElementById('ej-addflavor').click();    for(var i=0; i<flavor_nm.length; i++) flavor_nm[i].value = ingredients[i+1].split('|')[1];    for(var i=0; i<flavor_percent.length; i++) flavor_percent[i].value = ingredients[i+1].split('|')[0];        document.getElementsByClassName('flavor-vg')[0].click();    document.getElementsByClassName('flavor-vg')[0].click();})();

Usage

  1. Goto a recipe on alltheflavors. Click the CopyRecipe bookmark. This will copy the recipe into your clipboard (like you would with Ctrl+C).
  2. Goto the Steam-Engine e-liquid mixing page and click the PasteRecipe bookmark. In the input box, use Ctrl+v OR right-click paste. This will paste the recipe copied by the CopyRecipe macro and populate the ingredients input boxes. All the individual flavours will be pasted with their percentages.

​

Licence: Apache 2.0

Tested on Chrome

Hope it helps y'all :)

Comments
Sort
10 points
 
by Apexifiedabout 4 years agoThe Kingmaker

Why not just use the mix page on ATF?

3 points
 
by dustymadeabout 4 years ago

Any benefit of using steam engine over atf?

3 points
 
by duncanyoyo1about 4 years agoMixologist

Nope, it's actually less accurate as it doesn't have density information on flavors.

2 points
 
by dustymadeabout 4 years ago

I see.

So the densities are accurate for all flavors on steam?

3 points
 
by duncanyoyo1about 4 years agoMixologist

No that's the opposite of what I said.

Steam-engine is less accurate.

AllTheFlavors is more accurate.

Now to be fair, ATF doesn't use specific densities unless you tell it too. There's a check box in settings.

-1 points
 
by nuketro0p3rabout 4 years ago

Seems like a good point, but I never used the AFT mixer because they require me to log in which I don't like...

Edit 1: One advantage I see is that steam-engine allows you to select if flavor is VG based

1 points
 
by duncanyoyo1about 4 years agoMixologist

Why?

You don't need an account to mix recipes using the calc, you just hit the mix button on a recipe.

Also, you can't create an account on ATF directly, you log in with another account, like Google, Twitter, etc.

2 points
 
by nuketro0p3rabout 4 years ago

You're right. I didn't use the Mix functionality so I had no idea... The mix functionality looks useful. I'll give it a try sometimes. So far, Im more comfortable with steam because I've verified their calculations manually (except for ml => gms ratio they assume), and that worked for me so far.

For the account, I don't like connecting apps to my account because I don't like the clutter of who has information to what form my profile. I prefer keeping separate accounts so that it's harder for other companies to profile me...

2 points
 
by wheresandrewabout 4 years ago

Seems like a lot of work. Idc about logging in. I just stay logged in to both ATF and ELR. I use ELR more. There's a couple recipes on both that aren't on the other.

Site copyright © 2025 DIY Compendium. Data courtesy of Reddit.