This Node.js script is designed to interact with the Hubilo API to perform various tasks. It allows you to access and manipulate data related to an event on the Hubilo platform. The script can perform actions like bookmarking users, rating sessions, adding notes to users, and deleting notes.
Before using this script, make sure to set up the following:
- Node.js: Ensure you have Node.js installed on your system.
- Hubilo API Authentication: You need to obtain an authentication token for the Hubilo API and set it in a .env file. Refer to the Hubilo API documentation to obtain your token (open the network tab on your browser when you are logged and did you navigated the codemotion event platform website).
-
Clone this repository to your local machine.
-
Navigate to the directory containing this script.
-
Create a .env file and set your Hubilo API authentication key as follows:
HUBILO_AUTH=your_token_here
-
Open a terminal in the script directory and run the following commands:
npm install
This installs the required Node.js packages.
You can run the script with different modes based on your desired action. Replace mode with one of the following values:
- bookmark: Bookmark users on Hubilo.
- rate: Rate sessions on Hubilo.
- notes: Add notes to users on Hubilo.
- notes-delete: Delete notes from users on Hubilo.
npm start bookmark
npm rate
npm notes "Your message here"
npm notes loop "Your message here"
npm notes-delete
npm [mode] [v | verbose]
In the "notes" mode, you can use an additional argument to enter "loop" mode, which will continuously add notes to users at regular intervals.
node script.js notes loop "Your message here"
In loop mode, notes will be added to users at intervals of 2 seconds.
- The script defines a HubiloAPI class that encapsulates API interactions.
- It provides methods for retrieving speakers, attendees, leaderboard users, sessions, bookmarking users, rating sessions, adding notes, and removing notes.
- It checks the selected mode and executes the corresponding action.
- The script can run in different modes, such as bookmarking users, rating sessions, adding notes, or deleting notes.
- The verbose variable can be set to true for additional logging.
Feel free to modify and extend this script to suit your specific requirements.