Update: 2026-07-05 01:40:01

This commit is contained in:
Hamza-Ayed
2026-07-05 01:40:02 +03:00
parent 73d4778dab
commit 01652eed8b
3 changed files with 17 additions and 5 deletions
@@ -113,7 +113,7 @@ class FacebookBotService : AccessibilityService() {
delay(1000)
// 2. Read feed posts
val posts = commentReader.extractPostsAndComments().toMutableList()
val posts = commentReader.extractPostsAndComments().map { "[FEED]: $it" }.toMutableList()
// 3. Open comments if available
if (commentReader.openComments()) {
@@ -125,7 +125,7 @@ class FacebookBotService : AccessibilityService() {
delay(1000)
// 5. Read comments
val comments = commentReader.extractPostsAndComments()
val comments = commentReader.extractPostsAndComments().map { "[COMMENT]: $it" }
posts.addAll(comments)
// 6. Go back to feed
@@ -106,7 +106,7 @@ class InstagramBotService : AccessibilityService() {
val initialSize = allCollectedTexts.size
// 1. Read feed posts and comments on screen
val posts = navigator.extractPostsAndComments()
val posts = navigator.extractPostsAndComments().map { "[FEED]: $it" }
// Add to our global collection (Set avoids duplicates)
allCollectedTexts.addAll(posts)
@@ -114,9 +114,18 @@ class InstagramBotService : AccessibilityService() {
if (navigator.openComments()) {
Log.d(TAG, "Opened comments section...")
delay(3000)
val comments = navigator.extractPostsAndComments()
var comments = navigator.extractPostsAndComments().map { "[COMMENT]: $it" }
allCollectedTexts.addAll(comments)
// Scroll down inside the comments list to read more
for (i in 1..2) {
Log.d(TAG, "Scrolling inside comments (Scroll $i/2)")
navigator.scrollForward()
delay(2000)
comments = navigator.extractPostsAndComments().map { "[COMMENT]: $it" }
allCollectedTexts.addAll(comments)
}
// Go back to the feed
performGlobalAction(AccessibilityService.GLOBAL_ACTION_BACK)
delay(2000)