Skip to content

Instantly share code, notes, and snippets.

@Shugabuga
Created July 18, 2017 03:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shugabuga/e293cdcfe4d05e9e7702360608656176 to your computer and use it in GitHub Desktop.
Save Shugabuga/e293cdcfe4d05e9e7702360608656176 to your computer and use it in GitHub Desktop.
AmIShadowBanned Source Code
# Licensed under MIT. In addition to those terms, you must credit me (@HeyItsShuga) publicly, I suggest in the account's bio.
import twitter
import sched, time
def botProcess(sc):
api = twitter.Api(consumer_key='',
consumer_secret='',
access_token_key='',
access_token_secret='')
results = api.GetSearch(term='"Am I Shadowbanned"')
tweetID = int(results[0].id)
username = results[0].user.screen_name
try:
if api.GetSearch(term='from:' + username)[1]:
api.PostUpdate("Hey @" + username + ", you are not shadowbanned.", in_reply_to_status_id=tweetID)
try:
api.PostDirectMessage("Just to let you know, you are not shadowbanned.",screen_name=username)
print("DM sent.")
except:
print("No DM sent.")
print(username + " is not shadowbanned.")
else:
api.PostUpdate("Hey @" + username + ", you might be shadowbanned.", in_reply_to_status_id=tweetID)
try:
api.PostDirectMessage("Just to let you know, you might be shadowbanned.",screen_name=username)
print("DM sent.")
except:
print("No DM sent.")
print(username + " might be shadowbanned.")
except:
print("Dupe prevention for " + username)
results2 = api.GetSearch(term='"Am I Shadow banned"')
tweetID2 = int(results2[0].id)
username2 = results2[0].user.screen_name
try:
if api.GetSearch(term='from:' + username2)[1]:
api.PostUpdate("Hey @" + username2 + ", you are not shadowbanned.", in_reply_to_status_id=tweetID2)
try:
api.PostDirectMessage("Just to let you know, you are not shadowbanned.",screen_name=username2)
print("DM sent.")
except:
print("No DM sent.")
print(username2 + " is not shadowbanned.")
else:
api.PostUpdate("Hey @" + username2 + ", you might be shadowbanned.", in_reply_to_status_id=tweetID2)
try:
api.PostDirectMessage("Just to let you know, you might be shadowbanned.",screen_name=username2)
print("DM sent.")
except:
print("No DM sent.")
print(username2 + " might be shadowbanned.")
except:
print("Dupe prevention for " + username2)
s.enter(30, 1, botProcess, (sc,))
s = sched.scheduler(time.time, time.sleep)
s.enter(30, 1, botProcess, (s,))
s.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment