hackernews/client.py
def fetch_urls(urls, recursive=0):
    """Download (asynchronously) JSON from the urls.

    Params:
        urls : list[string] : list of urls to be fetched
        recursive : int : if positive, dig down to 'recursive' level of 'kids'

    Returns:
        list[dict] : list of dicts with HN posts in question
    """
    LOGGER.debug('fetching %s urls with recursive=%s', len(urls), recursive)
    loop = asyncio.get_event_loop()
    items = []
    with aiohttp.ClientSession(loop=loop) as session:
        items = loop.run_until_complete(
            async_fetch_urls(urls, session, recursive=recursive)
        )
    loop.close()
    return items
Download (asynchronously) JSON from the urls.

    Params:
        urls : list[string] : list of urls to be fetched
        recursive : int : if positive, dig down to 'recursive' level of 'kids'

    Returns:
        list[dict] : list of dicts with HN posts in question
    
Download (asynchronously) JSON from the urls.
Download ( asynchronously ) JSON from the urls .
def fetch_urls(urls, recursive=0):
    LOGGER.debug('fetching %s urls with recursive=%s', len(urls), recursive)
    loop = asyncio.get_event_loop()
    items = []
    with aiohttp.ClientSession(loop=loop) as session:
        items = loop.run_until_complete(
            async_fetch_urls(urls, session, recursive=recursive)
        )
    loop.close()
    return items
def fetch_urls ( urls , recursive = 0 ) : LOGGER . debug ( 'fetching %s urls with recursive=%s' , len ( urls ) , recursive ) loop = asyncio . get_event_loop ( ) items = [ ] with aiohttp . ClientSession ( loop = loop ) as session : items = loop . run_until_complete ( async_fetch_urls ( urls , session , recursive = recursive ) ) loop . close ( ) return items
Download (asynchronously) JSON from the urls.
Download ( asynchronously ) JSON from the urls .
"""Download (asynchronously) JSON from the urls.

    Params:
        urls : list[string] : list of urls to be fetched
        recursive : int : if positive, dig down to 'recursive' level of 'kids'

    Returns:
        list[dict] : list of dicts with HN posts in question
    """
list[dict] : list of dicts with HN posts in question
list [ dict ] : list of dicts with HN posts in question
urls
recursive
urls 
list[string] : list of urls to be fetched
list [ string ] : list of urls to be fetched
recursive 
int : if positive, dig down to 'recursive' level of 'kids'
int : if positive dig down to ' recursive ' level of ' kids '