Exemple #1
0
def schedule_post(my_page_id, copy_page_id, access_token):
    choice = "y"
    parameters = None
    while (choice != "n"):
        os.system("clear")
        posts = helper.get_post(copy_page_id,
                                access_token,
                                limit=1,
                                parameters=parameters)
        for post in posts:
            try:
                message = post["message"]
                print(post["message"])
                choice_post = raw_input(
                    "\n\nPress Enter To post .... \nPress x to see next post\nCtrl + Z to Exit"
                )
                if choice_post != "x":
                    time_sh = get_schedule_time()
                    print post_status.post_status(
                        page_id=my_page_id,
                        access_token=access_token,
                        message=message,
                        scheduled_publish_time=time_sh)
            except Exception as e:
                pass
        parameters = helper.next_page(copy_page_id,
                                      access_token,
                                      limit=1,
                                      parameters=parameters)
def read_post(page_id, access_token,limit,parameters=None):
    os.system("clear")
    posts = helper.get_post(page_id,access_token,limit, parameters=parameters)
    for post in posts:
        try:
            print(post["message"])
        except:
            pass
    parameters = helper.next_page(page_id, access_token, limit, parameters=parameters)
    return parameters
Exemple #3
0
def read_post(page_id, access_token, limit, parameters=None):
    os.system("clear")
    posts = helper.get_post(page_id,
                            access_token,
                            limit,
                            parameters=parameters)
    for post in posts:
        try:
            print(post["message"])
        except:
            pass
    parameters = helper.next_page(page_id,
                                  access_token,
                                  limit,
                                  parameters=parameters)
    return parameters
def schedule_post(my_page_id, copy_page_id, access_token):
    choice = "y"
    parameters = None
    while (choice != "n"):
        os.system("clear")
        posts = helper.get_post(copy_page_id,access_token,limit=1, parameters=parameters)
        for post in posts:
            try:
                message = post["message"]
                print(post["message"])
                choice_post = raw_input("\n\nPress Enter To post .... \nPress x to see next post\nCtrl + Z to Exit")
                if choice_post !="x":
                    time_sh = get_schedule_time()
                    print post_status.post_status(page_id=my_page_id, access_token=access_token, message=message, scheduled_publish_time=time_sh)
            except Exception as e:
                pass
        parameters = helper.next_page(copy_page_id, access_token, limit=1, parameters=parameters)