Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
brkagithub committed Feb 6, 2025
1 parent 21d4678 commit eef7384
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions packages/plugin-dkg/src/actions/dkgAnalyzeSentiment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,28 +393,25 @@ export const dkgAnalyzeSentiment: Action = {

const file = await fetchFileFromUrl(sentimentData.url);

await postTweet(
`${topic} sentiment based on top ${tweets.length} latest posts${
numOfTotalTweets - tweets.length > 0
? ` and ${numOfTotalTweets - tweets.length} existing analysis Knowledge Assets`
: ""
} from the past 48 hours: ${sentiment}
Top 5 most influential accounts analyzed for ${topic}:
${topAuthors
.slice(0, 5)
.map((a) => `@${a}`)
.join(", ")}
Analysis memorized on @origin_trail Decentralized Knowledge Graph ${
DKG_EXPLORER_LINKS[runtime.getSetting("DKG_ENVIRONMENT")]
}${createAssetResult.UAL} @${twitterUser}
This is not financial advice.`,
scraper,
postId,
file.data,
);
let tweetContent = `${topic} sentiment based on top ${tweets.length} latest posts`;
if (numOfTotalTweets - tweets.length > 0) {
tweetContent += ` and ${numOfTotalTweets - tweets.length} existing analysis Knowledge Assets`;
}
tweetContent += ` from the past 48 hours: ${sentiment}\n\n`;

tweetContent += `Top 5 most influential accounts analyzed for ${topic}:\n`;
tweetContent +=
topAuthors
.slice(0, 5)
.map((a) => `@${a}`)
.join(", ") + "\n\n";

tweetContent += `Analysis memorized on @origin_trail Decentralized Knowledge Graph `;
tweetContent += `${DKG_EXPLORER_LINKS[runtime.getSetting("DKG_ENVIRONMENT")]}${createAssetResult.UAL} @${twitterUser}\n\n`;

tweetContent += `This is not financial advice.`;

await postTweet(tweetContent.trim(), scraper, postId, file.data);

return true;
},
Expand Down

0 comments on commit eef7384

Please sign in to comment.