Actor

mtrunkat/delete-untitled-acts

  • Builds
  • latest 0.0.8 / 2018-05-03
  • Created 2018-05-03
  • Last modified 2018-09-05
  • grade 1

Description

Deletes all untitled acts from your account. In a minute. For free. With one click!


API

To run the actor, send a HTTP POST request to:

https://api.apify.com/v2/acts/mtrunkat~delete-untitled-acts/runs?token=<YOUR_API_TOKEN>

The POST payload will be passed as input for the actor. For more information, read the docs.


Example input

Content type: application/json; charset=utf-8

{ "hello": 123 }

Source code

Based on the apify/actor-node-basic Docker image (see docs).

const Apify = require('apify');
const request = require('request-promise');

Apify.main(async () => {
    const acts = await Apify.client.acts.listActs();
    const untitled = acts.items.filter(act => act.name.startsWith('untitled'));
    

    for (let act of untitled) {
        console.log(`Deleting act ${act.name}`);
        await Apify.client.acts.deleteAct({ actId: act.id });
    }
});