Skip to content

Commit

Permalink
ref: 1 time feed comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dhohirpradana committed Mar 8, 2023
1 parent 2f9abb8 commit 687acb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/commenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:

# Triggers the workflow with scheduler
schedule:
# every 1 hour
- cron: '0 * * * *'
# every 3 hour
- cron: '0 */3 * * *'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
10 changes: 5 additions & 5 deletions commenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ async function login() {
const translateQuote = await translateToID(quote);

console.log("✅ Get Quotes Success", translateQuote);

return translateQuote;
}

// like and comment 5 timeline feeds
console.log("🚀 Like Timeline Feeds 3 times");
let likeNcommentTimes = 3;
// like and comment 1 timeline feeds
console.log("🚀 Like Timeline Feeds 1 times");
let likeNcommentTimes = 1;

try {
const feed = ig.feed.timeline();
const items = await feed.items();

items.forEach(async (item) => {
if (likeNcommentTimes === 0) return console.log("✅ Like Timeline Feeds 3 times finished");
if (likeNcommentTimes === 0) return console.log("✅ Like Timeline Feeds 1 times finished");

if (item.user.username == "dhohirpradana") return console.log("❌ Skip own feed");

Expand Down

0 comments on commit 687acb2

Please sign in to comment.