Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Code generator for Phantombuster deployment #43

@fmaume

Description

@fmaume

Is your feature request related to a problem? Please describe.
Allow to deploy script on Phantombuster to use Phantombuster infra and scheduling option

Describe the solution you'd like
From puppeter code:
Add the following header:

// Phantombuster configuration {
"phantombuster package: 5"
"phantombuster command: nodejs"
"phantombuster flags: save-folder"
// }
const Buster = require("phantombuster")
const buster = new Buster()

Comment those lines:

//const prettier = require("prettier");
//const prompts = require("prompts");

Comment those lines:

      /*
      console.log({ variable0: formattedVariable0 });
      if (!promptContinue) {
        const response = await prompts({
          type: "confirm",
          name: "value",
          message: "Continue?",
          initial: true,
        });
        if (!response.value) {
          process.exit();
        }
        promptContinue = true;
      }
      data.push({ variable0: formattedVariable0 });
      bar.tick();*/
      }
      
    /*
    fs.writeFile(
      outputFilename || `./${new Date()}.json`,
      prettier.format(JSON.stringify(data), {
        parser: "json",
      }),
      (err) => {
        if (err) return console.log(err);
      }
    );
    */

Add the following lines to save the result:

let csvContent =  data.join("\r\n");
const saveAs = "texts/sample.csv"
const mime = "text/plain"
const url2 = await buster.saveText(csvContent, saveAs, mime)

replace all catch by catch (e).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions