User Profile and Bot Profiles Statistics done

This commit is contained in:
Luis Fernando Molina committed 2021-08-29 13:51:03 +02:00
1 parent dec4541210
commit 4c9701965a
4 files changed
+26 -16

No files matched your search

+8 -7
View File
@@ -15,13 +15,13 @@ exports.newBotProfileStats = function newBotProfileStats() {
function initialize(queryReceived) {
/*
Validate Bot Profile
Validate User Profile
*/
let userProfile
if (queryReceived.targetBotProfileId !== undefined) {
if (queryReceived.targetUserProfileId !== undefined) {
userProfile = NT.memory.maps.USER_PROFILES_BY_ID.get(queryReceived.targetUserProfileId)
} else {
userProfile = NT.memory.maps.USER_PROFILES_BY_HANDLE.get(queryReceived.targetUserProfileId)
userProfile = NT.memory.maps.USER_PROFILES_BY_HANDLE.get(queryReceived.targetUserProfileHandle)
}
if (userProfile === undefined) {
@@ -39,13 +39,14 @@ exports.newBotProfileStats = function newBotProfileStats() {
function execute() {
return {
"userProfileId": thisObject.profile.userProfileId,
"botProfileId": thisObject.profile.botProfileId,
"botProfileHandle": thisObject.profile.botProfileHandle,
"followingCount": thisObject.profile.followingCount,
"followersCount": thisObject.profile.followersCount,
"followingCount": thisObject.profile.following.size,
"followersCount": thisObject.profile.followers.size,
"postsCount": thisObject.profile.posts.size,
"emitterEventsCount": thisObject.profile.emitterEventsCount,
"targetEventsCount": thisObject.profile.targetEventsCount,
"postsCount": thisObject.profile.postsCount
"targetEventsCount": thisObject.profile.targetEventsCount
}
}
}
+5 -6
View File
@@ -26,7 +26,6 @@ exports.newUserProfileStats = function newUserProfileStats() {
if (thisObject.profile === undefined) {
throw ('Target User Profile Not Found.')
}
}
function execute() {
@@ -36,12 +35,12 @@ exports.newUserProfileStats = function newUserProfileStats() {
"userProfileHandle": thisObject.profile.userProfileHandle,
"blockchainAccount": thisObject.profile.blockchainAccount,
"ranking": thisObject.profile.ranking,
"followingCount": thisObject.profile.followingCount,
"followersCount": thisObject.profile.followersCount,
"followingCount": thisObject.profile.following.size,
"followersCount": thisObject.profile.followers.size,
"postsCount": thisObject.profile.posts.size,
"botsCount": thisObject.profile.bots.size,
"emitterEventsCount": thisObject.profile.emitterEventsCount,
"targetEventsCount": thisObject.profile.targetEventsCount,
"postsCount": thisObject.profile.postsCount,
"botsCount": thisObject.profile.botsCount
"targetEventsCount": thisObject.profile.targetEventsCount
}
}
}
+7
View File
@@ -1,5 +1,12 @@
exports.newQuery = function newQuery() {
/*
A Query is a call from a Network Client to
a Network Node with the purpose to get
relevant information from the Social Graph.
A Query does not produce changes
on the state of the Social Graph.
*/
let thisObject = {
query: undefined,
queryType: undefined,
+6 -3
View File
@@ -26,12 +26,14 @@ exports.newClientInterface = function newClientInterface() {
"eventType": 10,
"emitterUserProfileId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"targetUserProfileId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"emitterBotProfileId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"targetBBotProfileId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"emitterPostHash": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"targetPostHash": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"timestamp": 124234234234,
"botId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"botAsset": "BTC",
"botExchange": "Binance"
"botExchange": "Binance",
"botEnabled": true
}
*/
@@ -56,10 +58,11 @@ exports.newClientInterface = function newClientInterface() {
"targetUserProfileId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"emitterUserProfileHandle": "Luis-Fernando-Molina",
"targetUserProfileHandle": "Luis-Fernando-Molina",
"emitterBotProfileId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"targetBBotProfileId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"emitterPostHash": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"targetPostHash": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"timestamp": 124234234234,
"botId": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"botAsset": "BTC",
"botExchange": "Binance",
"botEnabled": true,