mirror of
https://github.com/alexal1/Insomniac.git
synced 2026-04-26 10:05:50 +03:00
[GH-ISSUE #1] Open and Close Instagram #3
Labels
No labels
bug
duplicate
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Insomniac#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GabrieleAnsaldo on GitHub (Jun 1, 2020).
Original GitHub issue: https://github.com/alexal1/Insomniac/issues/1
I guess you could open and close Instagram with the following code:
Also, you could add a function that goes through the Recent page of a certain hashtag and starts liking a certain number of pictures.
You could make various functions of possible actions that you can do:
I was thinking about how the following part could be implemented. Basically Instagram lets you go to your following page and see your followers ordered from the person you followed the latest. So basically if you follow 5 ppl you could just unfollow the latest 5 people. That's an idea. Otherwise, a slower process would be the one of going to each user's page and click the unfollow button.
Let me know if I could help somehow.
@GabrieleAnsaldo commented on GitHub (Jun 1, 2020):
Other things that could be added:
@alexal1 commented on GitHub (Jun 2, 2020):
@GabrieleAnsaldo thanks for ideas, they are really great!
Definitely all of them should be implemented. I just don't have much time, so will have to prioritize them. Following is the most important now, isn't it?
It's better to divide two processes: following and unfollowing. It gives more flexibility. If you want to do one immediately after another, you can run shell script like
Why going to each user's page? We can unfollow by buttons on the followings page.
P.S. I will VERY appreciate if you make pull requests. I see that you have great ideas and this script was originally your idea, I just applied UI Automator tool.
@gvmturl commented on GitHub (Jun 2, 2020):
Thank you guys! Any idea to unfollow non followers?
@alexal1 commented on GitHub (Jun 2, 2020):
@gvmturl a bit more tricky, but algorithm can be the following:
iterate over followings -> open each following -> go to his/her followings -> if you are followed back, you are on the first row -> return back and unfollow if not followed back -> return back to followings
So we can create such flags:
@GabrieleAnsaldo commented on GitHub (Jun 2, 2020):
Okay, thanks for the answer @alexal1! Tonight I will try to work on it a bit and send a pull request so that you can review it! I will try and make as many changes as possible.
Also, I am kinda new to UI Automator, I had a hard time looking for documentation. Do you have any suggestions on where I can find some examples and or documentation on how to use it properly?
@alexal1 commented on GitHub (Jun 2, 2020):
@GabrieleAnsaldo of course, all you need is
resourceIdandclassNameof UI elements there.https://developer.android.com/training/testing/ui-automator
@gvmturl commented on GitHub (Jun 3, 2020):
@alexal1 Thank you for replying, i will be waiting for this update...any solution for skipping private users?
@GabrieleAnsaldo please let us know when telegram integration is complete.
Could you add the command list to telegramBot as variables define as such flags defined on that script or something to autoadd IG functions to telegram? Also could be defined a variable as comment on IG Function that completes ¨HELP¨ function on telegram.
Is there anyway to storage all errors into a log? Like IndexError? I got this error here but script still running...
Is everything working with IGTV Videos? I Just seem it entered on a long video here... i will keep checking it... isn't better open a Bug reports as a issue or is there any better way to report that bugs here?
Thank you
@alexal1 commented on GitHub (Jun 3, 2020):
@gvmturl actually skipping private users works already (in not a very optimal way though). Algorithm tries to open a photo to like it.
If it can't – it scrolls (on some devices screen's height is too small and photos are not visible).
If it can't again – it skips user.
I don't know any way to detect private users without opening their profiles.
@alexal1 commented on GitHub (Jun 3, 2020):
@gvmturl this error occurs when opened screen is not the one the script expects. This happens sometimes, I fix these bugs as I can. Don't forget to
git pullsometimes. Script continues working because the other way such sudden stops would be frustrating. It starts current "blogger" from the beginning, so it's kind of "autofix" :)If you have some time to implement logging errors – it would be fantastic! Feel free to make PRs. I personally gonna do some more prioritized features first.
Yeah, creating separate bug issues would be great!
@alexal1 commented on GitHub (Jun 4, 2020):
Good news folks! @GabrieleAnsaldo @gvmturl
I've implemented Open and Close Instagram in
6eaa739971, so I'm closing this issue now.I also added
--repeat 180argument which makes the script to restart the session with exactly same settings in 180 minutes after completion. It continues indefinitely, until you stop the script by control+C. Instagram app is automatically being closed between sessions. This feature is disabled by default, until you add--repeat Nargument.So don't forget to
git pulland enjoy. Thanks for this discussion, if you have more ideas to add, please create separate Issues. It will help me to work on the script more efficient.@gvmturl commented on GitHub (Jun 8, 2020):
Hello @alexal1 i m still trying how everything works on this project to start helping on it...
could you explain me please where did you dump to get to get
com.instagram.android/com.instagram.mainactivity.MainActivityi see that originaly suggested @GabrieleAnsaldo using
os.system("adb shell monkey -p com.instagram.android 1 -")but you you used
os.popen("adb shell am start -n com.instagram.android/com.instagram.mainactivity.MainActivity").close()Could you explain me why you made it and what does it means...
I will be attentive to your comments.
Thank you.