Exemple #1
0
def recommended_non_linear_math(NAVSTACK, STATE):
    try:
        feed_items, STATE = arxiv_api.get_feed(topic='nlin', STATE=STATE)
        print('-' * 80)
        print('generating recommendations. standby...')
        feed_items, STATE = main_ml.predict(feed_items, STATE=STATE)
    except:
        navigable_menus.error(
            'request timed out or prediction algorithms have failed. standby...'
        )
    articles = navigable_menus.make_articles(feed_items, sys.modules[__name__])
    articles = navigable_menus.paginate(articles,
                                        page_length=10,
                                        menu_options=[
                                            ('main_menu', 'back'),
                                            ('main_menu', 'back_to_main'),
                                            ('CONTROL', 'previous_page'),
                                            ('CONTROL', 'next_page')
                                        ])
    action, STATE = navigable_menus.create(
        articles,
        header='main >> arxiv >> recommended >> non-linear math',
        STATE=STATE)

    return action, NAVSTACK, STATE
Exemple #2
0
def new_cs(NAVSTACK, STATE):
    try:
        feed_items, STATE = arxiv_api.get_feed(topic='cs', STATE=STATE)
    except:
        navigable_menus.error('request timed out. standby...')
        return ('main_menu', 'do_nothing'), NAVSTACK, STATE
    articles = navigable_menus.make_articles(feed_items, sys.modules[__name__])
    articles = navigable_menus.paginate(articles,
                                        page_length=10,
                                        menu_options=[
                                            ('main_menu', 'back'),
                                            ('main_menu', 'back_to_main'),
                                            ('CONTROL', 'previous_page'),
                                            ('CONTROL', 'next_page')
                                        ])
    action, STATE = navigable_menus.create(
        articles, header='main >> arxiv >> new articles >> cs', STATE=STATE)
    return action, NAVSTACK, STATE