Coder Social home page Coder Social logo

Comments (6)

edoardottt avatar edoardottt commented on June 10, 2024

Thanks for your submission Boroom, I'm gonna explain breiefly how this project works and so we can understand if this is the intended or unintended behavior.

Let's take a scenario: I have two users on twitter, edoardottt and edobot. The one I have access to API is edobot, this means I will set:

  • In the config.yaml file the api keys and tokens of edobot
  • In the globals.py file I will set user = "edoardottt" and bot_user = "edobot".

If now I start twitterbot 2 with python twitterbot2.py -k happy this will:

  1. Search for tweets related to the term "happy".
  2. Search for tweets in edoardottt 's timeline.

If you don't want to like and retweet edoardottt's tweets you have to execute python twitterbot2.py -k happy -nu. -nu means no user and will search (two times instead of one, so double tweets) only for terms happy.

Now, when you say "liking and retweeting my own tweets", you means your bot is liking and retweeting edobot's tweets or your personal user's tweets?

Thanks :)

from twitterbot2.

Boroom avatar Boroom commented on June 10, 2024

Maybe I misunderstood something but I'm trying to explain better what I've seen !

In your case, you're telling me that you have 2 accounts, one is your "personal" and the other the "bot" one (where you have the api keys).
In my case, I only have one account (and maybe this is the issue).
My twitter account was empty (no tweets, no friends, no like, nothing 🤣).

I ran python twitterbot2.py -k #MSB for example and it appears that there were only a few tweets where there was this #.
So first, it started correctly to like and retweet the tweets that were found and then, after a few seconds (and because there aren't other tweets anymore) started to tell me in the console that the bot was retweeting and favs the tweets from... my account ! And because my account was empty at the beginning, this means that it was trying to retweet the tweets I already retweeted ! I hope this was more clear. For each tweets like this, I got some errors on the logs.

Here are some of the logs like this you can see what I mean !

BasketFrElite: ERROR:2021-11-15 10:04:52,954 | HTTP Error 403: Forbidden on 1.1/favorites/create <----
BasketFrElite: INFO:2021-11-15 10:04:52,954 | Sleeping for ten seconds.
BasketFrElite: INFO:2021-11-15 10:05:02,965 | Today tweets count: 0
BasketFrElite: INFO:2021-11-15 10:05:02,965 | Today likes count: 0
BasketFrElite: INFO:2021-11-15 10:05:02,965 | Today retweets count: 0
BasketFrElite: INFO:2021-11-15 10:05:02,965 | Followers count: 0
BasketFrElite: INFO:2021-11-15 10:05:03,913 | Liked a tweet by BasketEliteFr
BasketFrElite: INFO:2021-11-15 10:05:04,218 | Database updated.
BasketFrElite: ERROR:2021-11-15 10:05:04,218 | HTTP Error 403: Forbidden on 1.1/favorites/create <----
BasketFrElite: INFO:2021-11-15 10:05:04,218 | Sleeping for ten seconds.
BasketFrElite: INFO:2021-11-15 10:05:14,232 | Today tweets count: 0
BasketFrElite: INFO:2021-11-15 10:05:14,232 | Today likes count: 0
BasketFrElite: INFO:2021-11-15 10:05:14,232 | Today retweets count: 0
BasketFrElite: INFO:2021-11-15 10:05:14,232 | Followers count: 0
BasketFrElite: INFO:2021-11-15 10:05:16,096 | Liked a tweet by BasketEliteFr
BasketFrElite: INFO:2021-11-15 10:05:17,425 | Database updated.
BasketFrElite: ERROR:2021-11-15 10:05:17,425 | HTTP Error 403: Forbidden on 1.1/favorites/create <----

from twitterbot2.

Boroom avatar Boroom commented on June 10, 2024

And I don't think that it is a behavior that was wanted ! But the error is well managed so it's not a real issue 😃
You could just see if the tweets is from myself, then don't do anything os something like that!

from twitterbot2.

edoardottt avatar edoardottt commented on June 10, 2024

Okay, got it. You should also provide the flag '-nu'. It means no user and with this option enabled the bot will not like and retweet your user tweets. See if this works :)

from twitterbot2.

Boroom avatar Boroom commented on June 10, 2024

In fact I thought using -nu was only used to avoid to retweet tweets.
The utility of the -nu was not clear for me in fact !

from twitterbot2.

edoardottt avatar edoardottt commented on June 10, 2024

Perfect, I think I can close the issue. :)

from twitterbot2.

Related Issues (20)

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.