adcash
v2.1.1
Published
Effortlessly automate your AdCash campaigns through Node.js, all powered by the Puppeteer framework.
Downloads
3
Readme
AdCash
AdCash is an unofficial Node.js library that allows you to effortlessly automate your AdCash campaigns through Node.js, all powered by the Puppeteer framework.
Getting Started
Installation
To use AdCash in your project, you'll also need to install Puppeteer. To install all the necessary libraries, run:
# Install the AdCash library
npm i adcash
# Install the Puppeteer framework
npm i puppeteer
In order for AdCash to work properly, you need to download a supported browser that can be used to automate Chrome. When you install Puppeteer, a recent version of
Chrome for Testing will be automatically downloaded at the $HOME/.cache/puppeteer
folder. This browser is known to work with Puppeteer.
To learn more about Puppeteer, you can visit the Puppeteer documentation.
Logging in
To get started with automating your AdCash campaigns, you'll first need to authenticate with your AdCash account. Please note that you'll need to run the commands asynchronously. To do this, you can use:
const AdCash = require('adcash');
(async () => {
const adCash = new AdCash();
await adCash.login('[email protected]', 'password123'); //Login to account
})();
By default, Puppeteer will use headless mode to automate your AdCash campaigns. If you would like to pass an argument for the Puppeteer browser, you can use:
const AdCash = require('adcash');
(async () => {
const adCash = new AdCash();
await adCash.login('[email protected]', 'password123', { headless: false, args: ['--start-fullscreen'] }); //Specify argument for Puppeteer
})();
Please make sure to replace the email and password provided in the example above with your AdCash account credentials.
Start or Stop
To start and stop your AdCash campaign, you can use the start() and stop() functions. An example of this would be:
const AdCash = require('adcash');
(async () => {
const adCash = new AdCash();
await adCash.login('[email protected]', 'password123');
adCash.start(12345678); //Starts the campaign
//...//
adCash.stop(12345678); //Stops the campaign
})();
When using this example, make sure to replace the digits with your AdCash Campaign ID. You do NOT need to run these command asynchronously.
Logging out
To log out of your current AdCash account, you can use:
const AdCash = require('adcash');
(async () => {
const adCash = new AdCash();
await adCash.login('[email protected]', 'password123');
await adCash.logout(); //Logout of account
})();
Cappings
To configure the cappings of your camapign, you can run:
const AdCash = require('adcash');
(async () => {
const adCash = new AdCash();
await adCash.login('[email protected]', 'password123');
await adCash.capping(12345678, ['', '10000', false]); //Sets the capping
})();
This command requires the following arguments:
- Your campaign ID
- An array with the daily budget, daily impressions, and whether or not you want to spread the budget throughout the day (true or false boolean)