Пример #1
0
def init_stream(user):
    if globalVars.output == 'curses':
        try:
            jackanapes.init_curses()
            user_stream = jackanapes.TweetArguments()
            user_stream.get_follow_stream(user)
        except tweepy.RateLimitError as e:
            print(e)
        except SystemExit:
            raise
        except KeyboardInterrupt:
            raise
        except BaseException as e:
            print(e)
            jackanapes.cleanup(1, e)
    elif globalVars.output == 'print':
        try:
            user_stream = jackanapes.TweetArguments()
            user_stream.get_follow_stream(user)
        except tweepy.RateLimitError as e:
            print(e)
        except SystemExit:
            raise
        except KeyboardInterrupt:
            raise
        except BaseException as e:
            print(e)
    elif globalVars.output == 'web':
        pass
Пример #2
0
def init_info(me, not_me=''):
    if me:
        try:
            jackanapes.init_curses()
            really_me = jackanapes.TweetArguments()
            really_me.show_my_info()
        finally:
            pass
    if not_me:
        try:
            jackanapes.init_curses()
            really_not_me = jackanapes.TweetArguments()
            really_not_me.show_not_me(not_me)
        finally:
            pass
Пример #3
0
def init_block(block, unblock, show):
    block_status = jackanapes.TweetArguments()
    if block:
        block_status.user_block(block)
    elif unblock:
        block_status.user_unblock(unblock)
    elif show:
        block_status.show_blocks()
Пример #4
0
def init_followers(user_username):
    """ \b
       This will download all of your followers (the people following you) and
       store the results by user_id in a file, by default called .followers
       and located in the application directory for the user.
    """
    followers = jackanapes.TweetArguments()
    followers.save_followers(user_username)
Пример #5
0
def init_follower_list(number):
    try:
        jackanapes.init_curses()
        followers = jackanapes.TweetArguments()
        followers.show_followers(number)
    except SystemExit:
        raise
    except KeyboardInterrupt:
        raise
    except BaseException as e:
        print(e)
Пример #6
0
def init_retweets(number):
    try:
        jackanapes.init_curses()
        retweets = jackanapes.TweetArguments()
        retweets.print_retweets(number)
    except SystemExit:
        raise
    except KeyboardInterrupt:
        raise
    except BaseException as e:
        print(e)
Пример #7
0
def init_time_line(number):
    try:
        jackanapes.init_curses()
        time_line = jackanapes.TweetArguments()
        time_line.print_time_line(number)
    except SystemExit:
        raise
    except KeyboardInterrupt:
        raise
    except BaseException as e:
        print(e)
Пример #8
0
def init_compare(me, user, file=''):
    """ \b
        This method makes various comparisons, based on input, between the local user
        and the various followers and friends they have; comparisons such as whether or
        not the people they follow follow them back. This is useful for account pruning.
    """
    compare = jackanapes.TweetArguments()
    if me is True:
        compare.compare_users('someclown')
    elif user:
        compare.compare_users(user)
    elif file:
        compare.compare_followers()
Пример #9
0
def init_testing():
    testing = jackanapes.TweetArguments()
    testing.set_testing()
Пример #10
0
def init_spamblock(user):
    spamblock = jackanapes.TweetArguments()
    spamblock.set_spam(user)
Пример #11
0
def init_friendship(follow, unfollow):
    friendship = jackanapes.TweetArguments()
    if follow:
        friendship.friendship_follow(follow)
    elif unfollow:
        friendship.friendship_un_follow(unfollow)
Пример #12
0
def init_save_objects(input_file):
    save_objects = jackanapes.TweetArguments()
    # save_objects.grab_user_object('/Users/someclown/.packetqueue/someclown/.followers')
    # operation_file = os.path.join(globalVars.complete_dir_path, globalVars.user, input_file)
    save_objects.grab_user_object(input_file)
Пример #13
0
def init_search_global(static, search_term, count):
    """ \b
        Search the global feed for a particular search term,
        and either displays [count] number of items, or
        streams in real-time.

        \n
        \b
SEARCH OPERATOR                         FINDS
-----------------------------------------------------------------------------------------------------------
watching now                            containing both “watching” and “now”. This is the default operator.
“happy hour”                            containing the exact phrase “happy hour”.
love OR hate                            containing either “love” or “hate” (or both).
beer -root                              containing “beer” but not “root”.
#haiku                                  containing the hashtag “haiku”.
from:interior                           sent from Twitter account “interior”.
list:NASA/astronauts-in-space-now       sent from a Twitter account in the NASA list astronauts-in-space-now
to:NASA                                 a Tweet authored in reply to Twitter account “NASA”.
@NASA                                   mentioning Twitter account “NASA”.
politics filter:safe                    containing “politics” with Tweets marked as potentially sensitive removed.
puppy filter:media                      containing “puppy” and an image or video.
puppy filter:native_video               containing “puppy” and an uploaded video, Amplify video, Periscope, or Vine.
puppy filter:periscope                  containing “puppy” and a Periscope video URL.
puppy filter:vine                       containing “puppy” and a Vine.
puppy filter:images                     containing “puppy” and links identified as photos, including third parties
                                        such as Instagram.
puppy filter:twimg                      containing “puppy” and a pic.twitter.comlink representing one or more photos.
hilarious filter:links                  containing “hilarious” and linking to URL.
superhero since:2015-12-21              containing “superhero” and sent since date “2015-12-21” (year-month-day).
puppy until:2015-12-21                  containing “puppy” and sent before the date “2015-12-21”.
movie -scary :)                         containing “movie”, but not “scary”, and with a positive attitude.
flight :(                               containing “flight” and with a negative attitude.
traffic ?                               containing “traffic” and asking a question.
\n
    """
    if static is True:
        if globalVars.output == 'curses':
            try:
                jackanapes.init_curses()
                this_search = jackanapes.TweetArguments()
                this_search.term_search(search_term, count)
            finally:
                pass
        elif globalVars.output == 'print':
            try:
                stream_search = jackanapes.TweetArguments()
                stream_search.get_stream_search(search_term)
            finally:
                pass
        elif globalVars.output == 'web':
            pass
    elif static is False:
        if globalVars.output == 'curses':
            try:
                jackanapes.init_curses()
                stream_search = jackanapes.TweetArguments()
                stream_search.get_stream_search(search_term)
            finally:
                pass
        elif globalVars.output == 'print':
            try:
                stream_search = jackanapes.TweetArguments()
                stream_search.get_stream_search(search_term)
            finally:
                pass
        elif globalVars.output == 'web':
            pass