Releases: cmalf/teneo-node-cli
Releases · cmalf/teneo-node-cli
TNC-V0.3
AutoLogin+Reconnect v0.2
📌 Added Saved data, access_token, refresh_token in DataAccount.json.
async function setAccountData(email, password, access_token, refresh_token, profileData) {
const accountData = { email, password, access_token, refresh_token, profileData };
await writeFileAsync('DataAccount.json', JSON.stringify(accountData));
}
📎 Slight Improvements and More Stable Version.
✎ᝰ. NOTE
- The Teneo team may release a major version of the Teneo node extension in the coming weeks, which will (probably) link to social media accounts like x (Twitter). Additionally, I don't think this cli version will continue to work in the main version as it is currently in beta testing.
Teneo-Node-Official
Teneo Nodes
- Teneo Node is officially on the Chrome Webstore
- Logout of your account on the old extension (delete the old extension)
- Fresh Install Official Teneo Node Chrome Webstore
- Login to your Account
- Connect your Node (You can still use this Cli Version)
- Nothing has changed from Teneo Node which is officially on the Chrome Webstore,
it's still the same as the old one
AutoReconnect Websocket
Because there was a problem when the "userID" in LocalStorage.json disappeared when WebSocket Disconnected,
I moved it separately in UserId.json, and I added AutoReconnect when websocket was disconnected,
I updated it in the JavaScript
or NodeJs
script, for other languages just adjust it yourself a little.
Using Reconnect Function
async function reconnectWebSocket() {
const userId = await getUserIdFromFile();
if (userId) {
await connectWebSocket(userId);
}
}
Implementation
socket.onclose = () => {
socket = null;
console.log("WebSocket disconnected");
stopPinging();
reconnectWebSocket();
};
Before Running the Script NodeJs
- You need to install all the necessary modules
- Run the command
below
npm install ws util fs readline axios
For VPS or Running 24/7
- This Script contains AutoLogin And AutoReconnect
- I Set Script to AutoLogin Every 1 hour to update "access_token" and "refresh_token" updated
- When running the script for the first time select Option 1, Log in to your account,
Your Account Data will be stored in DataAccount.json for automatic login to work.
Update
- Merged
- Improvements to the Logout Section, DataAccount.json forgot not to be deleted.
fs.unlink('DataAccount.json', (err) => {
if (err) throw err;
});