+def block():
+ """
+ Block a user
+ """
+ t = Twitter(auth=authen())
+ screen_name = g['stuff'].split()[0]
+ if screen_name[0] == '@':
+ try:
+ t.blocks.create(
+ screen_name=screen_name[1:],
+ include_entities=False,
+ skip_status=True)
+ printNicely(green('You blocked ' + screen_name + '.'))
+ except:
+ printNicely(red('Sorry something went wrong.'))
+ else:
+ printNicely(red('Sorry I can\'t understand.'))
+
+
+def unblock():
+ """
+ Unblock a user
+ """
+ t = Twitter(auth=authen())
+ screen_name = g['stuff'].split()[0]
+ if screen_name[0] == '@':
+ try:
+ t.blocks.destroy(
+ screen_name=screen_name[1:],
+ include_entities=False,
+ skip_status=True)
+ printNicely(green('Unblock ' + screen_name + ' success!'))
+ except:
+ printNicely(red('Sorry something went wrong.'))
+ else:
+ printNicely(red('Sorry I can\'t understand.'))
+
+
+def report():
+ """
+ Report a user as a spam account
+ """
+ t = Twitter(auth=authen())
+ screen_name = g['stuff'].split()[0]
+ if screen_name[0] == '@':
+ try:
+ t.users.report_spam(
+ screen_name=screen_name[1:])
+ printNicely(green('You reported ' + screen_name + '.'))
+ except:
+ printNicely(red('Sorry something went wrong.'))
+ else:
+ printNicely(red('Sorry I can\'t understand.'))
+
+