diff --git a/projects/Instgram-Bot/InstaBotgit.py b/projects/Instgram-Bot/InstaBotgit.py new file mode 100644 index 000000000..e643ca27b --- /dev/null +++ b/projects/Instgram-Bot/InstaBotgit.py @@ -0,0 +1,137 @@ + +#the code is hosted on github.com/engineervinay if you wanted to make development in code visit profile and fork the code +#if you have any query related to this code you can contact me on github @engineervinay + + + +from selenium.webdriver.common.keys import Keys #importing keys from selenium to enter the comments + +from time import sleep #time library for sleepcommand + +from random import randint #library to provide random integer values between range + +from selenium import webdriver as wb #the library for accesing chrome by our code + + +#window to accept inputs username, password, and hashtags +print("enter username:-") +user=input() +passw=input("enter password:-") +print("enter hashtags seperated by , :-") +hash=input() + + +# Change this to your own chromedriver path! +chromedriver_path = 'C:/Users/Vinay/Downloads/chromedriver_win32/chromedriver.exe' +webdriver = wb.Chrome(executable_path=chromedriver_path) + +sleep(2) +#opening instagram login page. +webdriver.get('https://www.instagram.com/accounts/login/?source=auth_switcher') + +sleep(3) + + + +username = webdriver.find_element_by_name('username')#finding username inputbox + +username.send_keys(user)#passing username. + +password = webdriver.find_element_by_name('password') +password.send_keys(passw) + + +#finding login button +button_login = webdriver.find_element_by_css_selector('#react-root > section > main > div > article > div > div:nth-child(1) > div > form > div:nth-child() > button') +#clicking on button +button_login.click() + +sleep(3) + + +#clicking on not now button which occurs when we logged in +notnow = webdriver.find_element_by_css_selector('body > div.RnEpo.Yx5HN > div > div > div.mt3GC > button.aOOlW.HoLwm') + +notnow.click() + + + +hashtag_list1=hash.split(",") +for hashtag in hashtag_list1: + + sleep(5) + webdriver.get('https://www.instagram.com/explore/tags/' + hashtag + '/') + + sleep(5) + + first_thumbnail = webdriver.find_element_by_xpath('//*[@id="react-root"]/section/main/article/div[1]/div/div/div[1]/div[1]/a/div/div[2]') + first_thumbnail.click() + + sleep(randint(1, 2)) + + + + for x in range(1, 200): + + #username = webdriver.find_element_by_xpath('/html/body/div[4]/div[2]/div/article/header/div[2]/div[1]/div[1]/h2/a').text + #if username not in prev_user_list: + # If we already follow, do not unfollow + + #if webdriver.find_element_by_xpath('/html/body/div[4]/div[2]/div/article/header/div[2]/div[1]/div[2]/button').text == 'Follow': + + #webdriver.find_element_by_xpath('/html/body/div[4]/div[2]/div/article/header/div[2]/div[1]/div[2]/button').click() + + #new_followed.append(username) + + #followed += 1 + + # Liking the picture + sleep(randint(3,7)) + #finding the like button using xpath + button_like = webdriver.find_element_by_xpath('/html/body/div[4]/div[2]/div/article/div[2]/section[1]/span[1]/button/span') + + button_like.click()#cliking on founded like button to like photo + + comm_prob =randint(1,4) + #to enable commenting box + webdriver.find_element_by_xpath('/html/body/div[]/div[2]/div/article/div[2]/section[3]/div/form/textarea').click() + #clicking on comment box + comment_box = webdriver.find_element_by_xpath('/html/body/div[]/div[2]/div/article/div[2]/section[3]/div/form/textarea') + sleep(randint(3,7)) + #code to post random comments + if comm_prob == 1: + #this statement will send the comment to the comment box + comment_box.send_keys('Really cool!') + sleep(5) + + elif comm_prob == 2: + + comment_box.send_keys('Nice work :)') + + sleep(5) + + elif comm_prob == 3: + + comment_box.send_keys('Nice gallery!!') + + sleep(5) + + elif comm_prob == 4: + + comment_box.send_keys('So cool! :)') + + sleep(5) + + + sleep(randint(4,6)) + comment_box.send_keys(Keys.ENTER)# Enter to post comment + sleep(randint(22, 28)) + + webdriver.find_element_by_link_text('Next').click()#clicking on next for next photo + + sleep(randint(25, 29)) + +###Developed by vinay patil + + + diff --git a/projects/Instgram-Bot/README.md b/projects/Instgram-Bot/README.md new file mode 100644 index 000000000..c9fb652a6 --- /dev/null +++ b/projects/Instgram-Bot/README.md @@ -0,0 +1,39 @@ +# InstgramBot +Instagram Bot which increases your followers.The objective of this project is to build a bigger audience and as a plus, maybe drive some traffic to your website.The script isn’t as sophisticated as it could be, and I know there’s lots of room to improve it. + +if you search for 'how to grow on Instagram' you can see the results like , engage with the peoples in your niche,use hashtags, etc. +This Bot will help you to get good Instagram followers and customers by liking and commenting on the post of hashtag specified. +there are many bots available online but they are not free. + +-BigBangram :- $24 per month +-InstaMacro :- $59.99per month +-Popamatic :-$39 per month +-Followadder :-$49-$425 per 6 months +-Ingramer :-38 euro +Because of mistakes made by developer a lot of account gets ban for using Instagram Bots. +Uploading your Instagram user id and password is also not the safe thing to do. +That's why I developed an Instagram Bot to do the Work for You. + + +The Bot is Developed Using Python 3 + ## Requirment + Python3,Selenium, a browser (in my case I’ll be using Chrome) and obviously, an Instagram account! + +## Working:- +- Open a browser and login with your credentials +- For every hashtag in the hashtag list, it will open the page and click the first picture to open it +- It will then like, comment and move to the next picture, in a 100 iterations loop (number can be adjusted) + + +> Full Version Develped by [Vinay Patil](https://github.com/engineervinay/) , if you want other O.S versions then do Check out version made by harsh https://github.com/theuitown/InstgramBot or you can check another branch(linuxcode) in this project made by him +Thanks to [harsh](https://github.com/theuitown/) + +## License & Copyright +© [Vinay Patil](https://engineervinay.github.io/) + +Licensed under the [MIT License](License) + +## Support Me +If you liked this, leave a star! :star: + +If you liked this and also liked my other work, be sure to follow me for more! :slightly_smiling_face: