Giter VIP home page Giter VIP logo

winbot-twitter-bot's Introduction

WinBot

Required

Make sure you have Python and Twython installed on your machine.

Connection with Twitter

You will need an app on twitter. You can create it right here: https://apps.twitter.com/
Now copy the

  • app_key
  • app_secret
  • oauth_token
  • oauth_token_secret

into winbot.py.

Run it

$ python winbot.py

Settings

Have a look at the tell_settings-function in winbot.py and tweak some settings to make this bot fit your needs. Use with caution.

var purpose recommended value
search_for tweets to search for in one cycle 20-120
cycles cycles (1 cycle = search for tweets, retweet, like, follow, unfollow) >1
sleep seconds to wai when interaction_limit is reached >120
interaction_limit interactions with API in a row (followed by sleep) 20-120
max_follow max. amount of users followed at a time <4000
max_mentioned_follow max. amount of users mentioned in a tweet to follow <4
search_query query used to search for tweets something related to giveaways

Blacklists

User

You can manually save more names of users (seperated by linebreak) you don't want to interact with. Unfortunately it's not possible to teach a bot to avoid interaction with blocked users. On the other hand the blacklist can be copied and used with multible other bots. The blacklist is useful, because every unwanted retweet costs time.

In case you got some more names, don’t hesitate to contribute them!

Strings

As required by Darkcast you can now save strings (e.g. hashtags) in this file – seperated by linebreak. The bot will ignore tweets with those strings.

Additional info

Why is this bot unfollowing users?

Following too many users at a time can get your bot blocked. Because of that, it also unfollows users (fifo-princliple).

It’s kinda time consuming - what can I do about that?

Theres not much you can do about that. Let this bot run on a raspberry or arduino, control it with cron and wait for some prices :)

Donate

Did you win cool stuff? Feel free to throw some cash for a beer in my direction:
Donate

winbot-twitter-bot's People

Contributors

jflessau avatar

Stargazers

 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  avatar  avatar  avatar

winbot-twitter-bot's Issues

update broke the app

after the recent update when I execute the application I the the following sceen and they it ends


--------------------------WinBot----------------------------


SETTINGS:
Search for 20 tweets in each cycle
amount of cycles: 2
sleeps for 180 seconds
whenever bot interacted 4 times with twitter-api
follows max. 3 users, who were mentioned in a tweet

Errors/Warnings:

create_friendship

Hi thx for your work and sorry for my bad english.
I use your work since 2 day and sometimes twitter.create_friendship doesn't work...
Did you know why?

problem

Hey, I'm testing the bot on my windows PC, but later on I want to use it on a Raspberry Pi or sth. like that.
First I have to say that I'm not very into this coding thing, maybe I made a stupid mistake, I don't know, so I hope you can help.
I installed Python and Twython, and added all access tokens into the winbot.py .
If I start the code in cmd, everything works, the bot retweets a giveaway tweet without a problem. But after this, nothing happens after the 144 seconds. Even after 10 Minutes, the bot isn't retweeting anymore - only one tweet at the beginning. What did I do wrong?

I hope that you can help me, I don't know what to do :(

But I have some ideas, too, to make the code better.
I found out that in some giveaways you have to rt and to fav. - An option to favorise the tweet would be very good.

The other thing is that the bot rt some fake giveaways. I think the chance to rt these fake giveaway tweets would be less, if there is an option that the bot retweets only, if the tweet has already, for example , 10 retweets.

Public blacklist

Hi there! Are there any public blacklists for winbot available? I currently use the following, started tweeting yesterday:

BotSp0tterBot
RealBotSp0tter
bottybotbot1
RealB0tSpotter

two tracebacks

After the bot finds a tweet to retweet, I get this message:

Traceback (most recent call last):
File "/private/var/root/Downloads/winbot-twitter-bot-master/winbot.py", line 167, in follow_user
twitter.create_friendship(screen_name=screen_name)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/twython/endpoints.py", line 388, in create_friendship
return self.post('friendships/create', params=params)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/twython/api.py", line 268, in post
return self.request(endpoint, 'POST', params=params, version=version)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/twython/api.py", line 258, in request
api_call=url)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/twython/api.py", line 194, in _request
retry_after=response.headers.get('X-Rate-Limit-Reset'))
twython.exceptions.TwythonAuthError: Twitter API returned a 401 (Unauthorized), An error occurred processing your request.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/private/var/root/Downloads/winbot-twitter-bot-master/winbot.py", line 289, in
win_things()
File "/private/var/root/Downloads/winbot-twitter-bot-master/winbot.py", line 35, in win_things
get_intimate_with(filtered_tweets)
File "/private/var/root/Downloads/winbot-twitter-bot-master/winbot.py", line 116, in get_intimate_with
follow_author(tweet)
File "/private/var/root/Downloads/winbot-twitter-bot-master/winbot.py", line 177, in follow_author
followed_num = follow_user(tweet["user"]["screen_name"])
File "/private/var/root/Downloads/winbot-twitter-bot-master/winbot.py", line 171, in follow_user
print("FAILED to follow " + screen_name.encode("ascii", "ignore"))
TypeError: must be str, not bytes

Sytax Error

Sry I get an syntax error in this part of the code:

print "\n\n\nstart cycle: " +str(i + 1)

Regards

list index out of range error

Hello, I made 5 bots running on my raspberry Pi, 4 Bots are running without any problem, but the fifth bot has this error (I don't know how to fix it, it's the same code on all of the 5 bots):

start cycle: 1 Traceback (most recent call last): File "winbot.py", line 289, in <module> win_things() File "winbot.py", line 31, in win_things filtered_tweets = filter_tweets(fresh_tweets) File "winbot.py", line 65, in filter_tweets tweets = past_retweets_filter(tweets) File "winbot.py", line 93, in past_retweets_filter past_retweets = get_past_retweets() File "winbot.py", line 50, in get_past_retweets line = line[3] IndexError: list index out of range
What did I make wrong?

Can't launch the script from another directory

Hey !
First of all, thank you for the script. There is just one thing : I don't really understand how the search_query works, has I use very specific words in French and the bot isn't able to find the tweets, even though I'm manually finding them. If you could just explain it a bit in the documentation, it would be great ! (Very nice doc by the way!)

I've got a small problem with the script : when I launch it from another directory (for example : python winbot-twitter-bot/winbot.py ), the script can"t find the blacklisted-users.txt file :-( (here's the full
error :

Traceback (most recent call last):
  File "winbot-twitter-bot/winbot.py", line 290, in <module>
    win_things()
  File "winbot-twitter-bot/winbot.py", line 31, in win_things
    filtered_tweets = filter_tweets(fresh_tweets)
  File "winbot-twitter-bot/winbot.py", line 63, in filter_tweets
    tweets = blacklisted_users_filter(tweets)
  File "winbot-twitter-bot/winbot.py", line 70, in blacklisted_users_filter
    blacklisted_users = get_list("blacklisted-users.txt")
  File "winbot-twitter-bot/winbot.py", line 40, in get_list
    file = open(filename, "r")
IOError: [Errno 2] No such file or directory: 'blacklisted-users.txt'

That's odd because I wanted to set the bot on my Debian Server and schedule it with Cron, but I can't since the script can't be launched from another directory.

Do you know where it comes from ?

Thank you for your help !

search query problem

Hello,

I wanted to add German words to the search query. I added them with an OR to rt2win and retweet to win, but I found out that the winbot search only for the first words, so rt2win, not the German words.
How can I fix this problem, so the winbot is mixing the search query words?

Blacklist

Hi, how do you go about blocking people on the blacklist? Is there another bot you use for this? If so, what's it called?

Many thanks :)

Twython installation

i have trouble installign twython.Could u link me ur discord id so i can message u?

Issue

I ran a test and I got more bot searching for retweet bots than anything, is there a way to black list via keywords and hash tags?

'Like' a tweet

Hi,

Are you looking at adding a 'like' function to your code? A lot of competitions want you to like & retweet.

Keep up the good work!

SyntaxError

File "winbot.py", line 30
print '\n\n\nstart cycle:' +str(i + 1)
^
SyntaxError: invalid syntax

Follower

Is the bot following every person by retweeting a tweet? Would be good having an option not to follow a person if the giveaway tweets contains not the word "follow" because there are giveaways where you only have to rt a tweet.

Ban

I was ban by twitter... My settings was :
settings = {
"search_for" : 50,
"cycles": 15, "sleep" : 150,
"interaction_limit" : 2,
"max-follow" : 4000,
"max_mentioned_follow" : 3,
"search_query" : "Concours Follow"
}

Did you know why?

Limited Results

Hi, thank you for this excellent bot, just started using it.

Having a couple of issues where the results are limited and receive repetitive search results. I use a competition site that lists 1000s of twitter giveaways and would like to reduce the manual effort involved by using your bot.

Having read the Twitter API search details I see this could be due to a 7 day limit on search results or am I missing something else here? I have tried changing my search criteria while using 'OR' to increase the outcome but still have very few results, giving the bot nothing left to do.

Could you please provide any details on ways to increase productivity or perhaps offer suggestions to use for my searches.

Thanks.

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.