Git Product home page Git Product logo

python-twitter-bot's Introduction

Python-Twitter-Bot

Python Twitter Bot

1.To use Twitter bot,you need to have Python 3 installed on your system.This bot uses tweepy module.You can install tweepy by using pip.To install tweepy, use this command :

$ pip install tweepy

2.Now,you need to create a new application on Twitter. Either you can use your existing account or you can create a new one.Creating a new account for bot is better so that your original Twitter account does not get banned.To create a new application on Twitter,open this URL in your browser : https://apps.twitter.com/

3.Fill all details required to create the new app.After that ,click on "Key and Access Token" tab under app settings.You will get your app's Consumer Key (API Key , Consumer Secret (API Secret) .You also need to get Access Token and Access Token Secret of your app.We will use these valuse in next step.You need to generate Access Token for first time.

4.Edit credentials.py and copy-paste all your details carefully.

5.Now,you can run twitterbot_text.py file to run bot which will tweet The Zen of Python texts by using this command :

$ python twitterbot_text.py

Twitter Text Bot Screenshot

6.You can also use any file instead of sample.txt . To do that,you need to open twitterbot_text.py file and edit this line my_file=open('sample.txt','r') and enter your desired filename instead of 'sample.txt' .

7.Enjoy the service of Twitter Bot which tweets texts of a file .You can also alter sleep time in script as you wish.

Twitter bot which retweet,like,and follow

8.Use twitterbot_retweet.py file for a Twitter bot which retweet tweets based on particular hastag (script provided here use #python ),like tweets and follow the user who tweeted it .Set your desired Bot settings such as QUERY,LIKE,FOLLOW in config.py file To run twitterbot_retweet.py ,use this command :

$ python twitterbot_retweet.py

Twitter Retweet Bot

9.You can use any desired hastag(such as #javascipt ) .Just edit hastag '#python' in config.py file with whatever you want.

  1. You can also edit code if you do not want your bot to follow users or you do not want your bot to like tweets.

11.You can also deploy Twitter bot on online based servers if you want to run the bot 24 hours continously.Take care of sleep/delay if you run bot the whole day.You should try to use large sleep time so that your account does not get banned.

python-twitter-bot's People

Contributors

gauravssnl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-twitter-bot's Issues

api.search errors

Twitter bot which retweets,like tweets and follow users
Bot Settings
Like Tweets : False
Follow users : False
Traceback (most recent call last):
File "twitterbot_retweet.py", line 15, in
for tweet in tweepy.Cursor(api.search, q=QUERY).items():
AttributeError: 'API' object has no attribute 'search'

error - line 15, in <module>

Git this error when i start the RT boot.

Twitter bot which retweets,like tweets and follow users
Bot Settings
Like Tweets : True
Follow users : True
Traceback (most recent call last):
  File "/home/Python-Twitter-Bot/twitterbot_retweet.py", line 15, in <module>
    for tweet in tweepy.Cursor(api.search, q=QUERY).items():
AttributeError: 'API' object has no attribute 'search'

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.