Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV Importer for warframe mastery helper #278

Closed
Coconutcoo opened this issue Jan 9, 2025 · 4 comments
Closed

CSV Importer for warframe mastery helper #278

Coconutcoo opened this issue Jan 9, 2025 · 4 comments

Comments

@Coconutcoo
Copy link

Coconutcoo commented Jan 9, 2025

Description

I currently use an alternative site, https://warframe-mastery.com/helper/, which is closing down and your site looked an excellent alternative. Would you consider adding a CSV import to allow migrations without needing to type everything back in?

Extra Information

I've attached an export of my CSV there, though it's a pretty simple format. It has a header row (Name, Status), and then the item name and either "" or "Checked" as the status.
warframe-mastery.csv

@DaPigGuy
Copy link
Member

DaPigGuy commented Jan 10, 2025

Does the CSV contain Star Chart mission nodes, or just items? An exported CSV would be nice to have for testing

@Coconutcoo
Copy link
Author

Apologies, I meant to attach it - added it now. It doesn't contain star chart entries, or any intrinsics, just gear selections.

@DaPigGuy
Copy link
Member

DaPigGuy commented Jan 10, 2025

I've made it possible to programatically update items

You can open up your browser's dev tools (Right Click -> Inspect) and enter the following into the Console:

const input = document.createElement("input");
input.type = "file";
input.click();

input.onchange = e => {
    const reader = new FileReader();
    reader.readAsText(e.target.files[0]);

    reader.onloadend = () => {
        const csv = reader.result;
        const items = csv.trim().split("\n");
        for (let i = 1; i < items.length; i++) {
            let [name, checked] = items[i].split(",");
            name = name.replaceAll(`"`, "");

            if (name.endsWith(" Strike")) name = name.replace(" Strike", ""); // Zaws
            if (name.endsWith(" Hound)")) name = name.split("(")[0].trim(); // Hounds
            if (name === "Voidrig Necramech") name = "Voidrig";
            
            framehub.masterItem(name, checked === "Checked");
        }
    }
}

It should prompt you with a file chooser where you can select the csv file. Give it about 10-15 seconds and your items should be updated. You will have to manually do Star Chart / Steel Path / Intrinsics. You can also select between ranks 30-40 for Paracesis, Kuva Lich, etc weapons by clicking on those items.

@Coconutcoo
Copy link
Author

Absolutely fab, thank you! I had started having a go at implementing it myself but didn't think to just expose the method instead. I'm a BE/DevOps and all this frontend magic takes me a moment :)

I did struggle since FF blocks programmatic click() actions, but just did it in Chrome instead, for anyone else that might be trying to migrate.

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

No branches or pull requests

3 participants