Skip to content

Instantly share code, notes, and snippets.

@coffnix
Last active June 21, 2021 00:33
Show Gist options
  • Save coffnix/be7486d4771de50b3fa84be115de7eb5 to your computer and use it in GitHub Desktop.
Save coffnix/be7486d4771de50b3fa84be115de7eb5 to your computer and use it in GitHub Desktop.
InstaPy scripts
* * * * * root /root/run.sh
(funtoo) dell_notebook ~ # cat /root/run.sh
#!/bin/bash
su - coffnix -c /home/coffnix/InstaPy/run.sh
(funtoo) dell_notebook ~ # cat /home/coffnix/InstaPy/run.sh
#!/bin/bash
#set -x
data_hora() {
echo "[$(date +'%Y/%m/%d') $(date +'%H:%M:%S')]"
}
# Criando LOCK do script....
LOCK="/tmp/run.sh.lock"
{
if ! flock -n 667; then
echo -e "$(data_hora) Script rodando.... saindo imediatamente.\n"
exit 1
else
cd /home/coffnix/InstaPy
/usr/bin/python /home/coffnix/InstaPy/desseguir-insta.py &> /home/coffnix/InstaPy/desseguir-insta.log
fi
} 667>${LOCK}
# Removendo arquivo de LOCK...
rm $LOCK
from instapy import InstaPy
session = InstaPy(username='seuuser', password='sua_senha', nogui=True)
session.login()
session.unfollow_users(amount=450, InstapyFollowed=(True,"all"), style="FIFO", sleep_delay=420)
session.end()
emerge >=dev-python/selenium-3.13.0 >=dev-python/PyVirtualDisplay-0.2.1 >=www-apps/chromedriver-bin-2.41
pip install --user easyprocess
pip install --user clarifai
pip install --user emoji
pip install --user plyer
git clone https://github.com/timgrossmann/InstaPy
cd InstaPy
cp /usr/bin/chromedriver assets/chromedriver -p
from instapy import InstaPy
session = InstaPy(username='seuuser', password='sua_senha', nogui=True)
session.login()
session.set_relationship_bounds(enabled=False)
#aqui segue 450 seguidores do user com sleep_delay
session.follow_user_followers(['user'], amount=450,sleep_delay=420)
#descomentar para: aqui segue 450 perfis seguidos pelo user
#session.follow_user_following(['user'], amount=450,sleep_delay=300)
session.end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment