Giter Site home page Giter Site logo

rajatkhatri7 / twitterbot Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 359 KB

Now a days everything is going on automation .We live in the api world. A good example is the bots which we are using now a days . We see that on every website there is a Bot which helps in answering simple queries , they are smart enough. isn't it appears interesting to you . So in this repository I will we will make a twitter bot from scratch and later we will add more functionality in it. Follow the steps below.

License: Apache License 2.0

Python 99.81% HTML 0.19%

twitterbot's Introduction

twitterBot

Now a days everything is going on automation .We live in the api world. A good example is the bots which we are using now a days . We see that on every website there is a Bot which helps in answering simple queries , they are smart enough. isn't it appears interesting to you . So in this repository I will we will make a twitter bot from scratch and later we will add more functionality in it. Follow the steps below.


Creating Twitter API Authentication Credentials

The Twitter API requires that all requests use OAuth to authenticate. So you need to create the required authentication credentials to be able to use the API. These credentials are four text strings:

1.Consumer key 2.Consumer secret 3.Access token 4.Access secret

Step 0 Email Verification

First go to Twitter Signin withyour account and verify your email id by going to ...more >Setting and security >Email Enter your email there there and then it will send a link to your gmail account . Go to your gmail account and click verify.

Step 1 Apply for a Twitter Developer Account

Visit Twitter Developer and click on Signin at top right corner.Here sign in with your twitter accaount. Then after Signin Click on Apply at top right corner.

apply image

Step 2 Apply for Bot

Click on create a bot if a window will appear to you. Then click on continue and fill the all necessary details which it asking. Its quite booring its a long form but somOne says "Patience is the key to success" so keep patience and fill it.

Step 3 Email verification again

After filling all the details it will ask for the email verification "Privacy matters" so again go to the gmail account and verify.

Step 4 Creating the credintails

Now you will see your Name and Profile at top right corner. Click on the your name and from list click on Apps. In the next window click on create> You will see that it is asking for some details . For now we will fill the details only (required details) do not fill anthing where (required)is not written . In the website url section and callback url section fillcopy this and paste https://consistant.netlify.app/ [Visit Website] (https://consistant.netlify.app/) this web is developed by me to stay consistant whole day. Tick mark the Enable signin with twitter, Fill the details and click on create.

image

image

image

Step 5

You will see a window like below. Click onKeys and tokens . You will see API KEY,API SECREAT key and for access and tokens Click on generate .A pop up will appear copy the access token and access token secreat becoz if u back it will not show to u. WE will use these token in python Script to create a bot.

image

image

Step 6 Installing Python and tweepy

Now to run the bot we write a python script. For this go to ,for windows user Python Website , and for linux python is already instlled in your system . If u want specifict version type apt-pip install python3.

Now we will install Tweepy which will help in automation. Windows user go to command prompt and type pip install tweepy Linux user open terminal and type pip3 install tweepy

step 7 Final Destination

Now copy the above [retweet.py] file open it in any text editor and paste your api key and other credentials in the file . and replace the query with whatever keyword u want, Then save this file.

Now run this file by command promt or by terminal python3 retweet.py

Volia!! We have created the Bot to retweet the tweets with the given hashtag in query.

To Automate more like auto like and follow read the docs of Tweepy.

Fork this repository if you want to contriute to this and give a star if you this. :)

twitterbot's People

Contributors

rajatkhatri7 avatar

Stargazers

shamil ollakkan avatar Akhil T J avatar Rafi Rasheed T C  avatar Muhammed Hilal avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.