Grimasaur
Junior Member
- Apr 8, 2016
- 191
- 100
Making a twitter bot and showing how i do it
Hello guys, i will make the bot using python + selenium ,i already have experience in coding but mostly in java where i have used selenium before but i want to learn python so i will use python.
im not an expert coding but not a newbie i have my general knowlenge of coding but i have to apply that specifically to python.
I start this journey just to make myself focus and finish this bot since im a person who usually gives up on things , and that its something that i dislike so i want to change it and i will start making this bot.
I will put the features i want to include or new features that i think later , it will be nice if you guys tell me what you would like the bot to have so i may put it too.
right now the bot can do this:
btw some features may seem obvious but are part of the bot , on the next post i will explain some parts more deeply or some of the functions the bot has or uses that the user wont see , like how the functions interact with themselves etc.
Features will be on green
To do will be on yellow
Know bugs will be on red
Finished today will be on blue
New functions added will be on orange
Bugs eliminated will be just deleted
btw if someone its curious i was mostly inspired reading @apex1 journey and my idea is to code this bot and start to sell it,
Right now im coding the unfollowing function , still basic since the core of the bot isnt even started right now im just doing some basic functions that later will be modified for example some functions now require the attribute of the name of the account to simplify some things to do but later i will store the name of the account as an attribute of the class so all functions can access it, the unfollowing function now is as follows
(its on pseudocode so anyone can understand it)
unfollow(name):
now i want to make that you unfollow people based on some interval of people that the program gives you and also you unfollow a certain amount of people , example
you set unfollow time interval to betweet 10 to 20 sec and unfollow amount to 2 to 5
so an example will be 13 secconds delay 3 people unfollowed then you get 16 seccond delay 2 people unfollowed , i think you get it guys.
so to code it we will have to pass that attributes to the function
unfollow(name,min time,max time,min people,max people):
now we get a random number between the interval , on python i use the function randrange(min,max)
so it will be
time=randrange(min time,max time)
people=randrange(min peolpe,max people)
now from our old method we edit a few things, we want our list of people to be the size of the people that we want to unfollow this time (this will change later you will see maybe other day)
so on python its easy
personlist = driver.find_elements(people to unfollow)[:people]
with [:X] you get the X first elements of a list , but on our method this may get us some problems since maybe there isnt enought people so we will add some scroll down method until we get enought people
(later this will be determined also by the number of people you are following so we dont get stuck if we want to unfollow 10 people and we only follow 1)
personlist = driver.find_elements(people to unfollow)
while(tamaño personlist < people):
now we get our list of persons to unfollow , and for the timing interval we just have to put a sleep
sleep(time)
and we will end with something like this
unfollow(name,min time,max time,min people,max people):
Hello guys, i will make the bot using python + selenium ,i already have experience in coding but mostly in java where i have used selenium before but i want to learn python so i will use python.
im not an expert coding but not a newbie i have my general knowlenge of coding but i have to apply that specifically to python.
I start this journey just to make myself focus and finish this bot since im a person who usually gives up on things , and that its something that i dislike so i want to change it and i will start making this bot.
I will put the features i want to include or new features that i think later , it will be nice if you guys tell me what you would like the bot to have so i may put it too.
right now the bot can do this:
btw some features may seem obvious but are part of the bot , on the next post i will explain some parts more deeply or some of the functions the bot has or uses that the user wont see , like how the functions interact with themselves etc.
Features will be on green
To do will be on yellow
Know bugs will be on red
Finished today will be on blue
New functions added will be on orange
Bugs eliminated will be just deleted
- login (obvious)
- follow people
- follow people based on keywords
- follow people between time intervals
- follow a certain number of people each interval
- unfollow
- unfollow people based on the time you followed them
- unfollow people between time invervals
- unfollow a certain number of people each interval
- delete tweet
- delete a certain number of tweets ( can also delete them all)
- gets stuck when there is a retweet
- delete a certain number of tweets ( can also delete them all)
- tweet
- schedule tweets for a certain time
- get followers number
- get following number
- get tweet number
- use proxy (only tested with public proxy)
- retweet
- fav
- retweet based on keyword
- fav based on keyword
- reply to people
- reply people that tweeted certain words (example "how do i do x thing" reply "you can use x program")
- post picture
- send dm
- send dm when people follow you
- copy tweets from accounts
- copy pictures from accounts
btw if someone its curious i was mostly inspired reading @apex1 journey and my idea is to code this bot and start to sell it,
Right now im coding the unfollowing function , still basic since the core of the bot isnt even started right now im just doing some basic functions that later will be modified for example some functions now require the attribute of the name of the account to simplify some things to do but later i will store the name of the account as an attribute of the class so all functions can access it, the unfollowing function now is as follows
(its on pseudocode so anyone can understand it)
unfollow(name):
if ( the url isnt "twitter"+name+"/following")
for person in personlist:
go to ("twitter"+name+"/following")
personlist = driver.find_elements(people to unfollow)for person in personlist:
wait until the unfollow button its visible #just in case it isnt visible to eliminate bugs
click the unfollow button
click the unfollow button
now i want to make that you unfollow people based on some interval of people that the program gives you and also you unfollow a certain amount of people , example
you set unfollow time interval to betweet 10 to 20 sec and unfollow amount to 2 to 5
so an example will be 13 secconds delay 3 people unfollowed then you get 16 seccond delay 2 people unfollowed , i think you get it guys.
so to code it we will have to pass that attributes to the function
unfollow(name,min time,max time,min people,max people):
now we get a random number between the interval , on python i use the function randrange(min,max)
so it will be
time=randrange(min time,max time)
people=randrange(min peolpe,max people)
now from our old method we edit a few things, we want our list of people to be the size of the people that we want to unfollow this time (this will change later you will see maybe other day)
so on python its easy
personlist = driver.find_elements(people to unfollow)[:people]
with [:X] you get the X first elements of a list , but on our method this may get us some problems since maybe there isnt enought people so we will add some scroll down method until we get enought people
(later this will be determined also by the number of people you are following so we dont get stuck if we want to unfollow 10 people and we only follow 1)
personlist = driver.find_elements(people to unfollow)
while(tamaño personlist < people):
scroll down
personlist = driver.find_elements(people to unfollow)
personlist = personlist[:people]personlist = driver.find_elements(people to unfollow)
now we get our list of persons to unfollow , and for the timing interval we just have to put a sleep
sleep(time)
and we will end with something like this
unfollow(name,min time,max time,min people,max people):
time=randrange(min time,max time)
people=randrange(min peolpe,max people)
if ( the url isnt "twitter"+name+"/following")
while(tamaño personlist < people):
for person in personlist:
I hope you guys find this usefull , see you on the next post! btw i dont know how much frequently i will post , but atleast once a week but anyway i will be there answering you guys on comenting how to do things better see you!people=randrange(min peolpe,max people)
if ( the url isnt "twitter"+name+"/following")
go to ("twitter"+name+"/following")
personlist = driver.find_elements(people to unfollow)while(tamaño personlist < people):
scroll down
personlist = driver.find_elements(people to unfollow)
personlist = personlist[:people]personlist = driver.find_elements(people to unfollow)
for person in personlist:
wait until the unfollow button its visible #just in case it isnt visible to eliminate bugs
click the unfollow button
sleep(time)click the unfollow button