Code Monkey home page Code Monkey logo

mostsubytmusicchannels's People

Contributors

dependabot[bot] avatar marco97pa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mostsubytmusicchannels's Issues

Numeric hashtags

Issue:

As you can see in this tweet, the bot posted a tweet using a numeric hashtag (which is not valid).

Solution:

We should edit the gen_hashtags(s) function to check if the hashtag to be added is numeric or not

Catch Tweet Duplicate Error

Sometimes Tweepy could trigger a Tweet Duplicate Error if the last tweet posted and the new one you are trying to post is the same or almost the same.

For example, if an artist increases his subs by 0.2 in one hour, the Bot will try to post two tweets almost the same but with a single digit changed. This could lead to that error.

To fix it we need to catch the error and continue execution without posting anything on Twitter. This way we can still continue to edit the contents of channel.csv.
If the execution is terminated due to this error, the side effect is that the channel.csv is not written with the new data and could possibly lead to more errors like this.

Traceback:

Traceback (most recent call last):
  File "main.py", line 211, in <module>
    channels = update_subscribers(response, channels)
  File "main.py", line 90, in update_subscribers
    subs_notify_change(channel)
  File "main.py", line 101, in subs_notify_change
    twitter_post("{} reached {} Million subscribers on YouTube\n@{} #music #youtube #stats".format(channel["name"], int(channel["subs"])/1000000, channel["username"]))
  File "main.py", line 155, in twitter_post
    api.update_status(message)
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/tweepy/api.py", line 205, in update_status
    return bind_api(
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/tweepy/binder.py", line 253, in _call
    return method.execute()
  File "/opt/hostedtoolcache/Python/3.8.6/x64/lib/python3.8/site-packages/tweepy/binder.py", line 234, in execute
    raise TweepError(error_msg, resp, api_code=api_error_code)
tweepy.error.TweepError: [{'code': 187, 'message': 'Status is a duplicate.'}]

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.