

def get_stories(self, story_type='', limit=30):
    "\n        Yields a list of stories from the passed page\n        of HN.\n        'story_type' can be:\n        \t'' = top stories (homepage) (default)\n        \t'news2' = page 2 of top stories\n        \t'newest' = most recent stories\n        \t'best' = best stories\n\n        'limit' is the number of stories required from the given page.\n        Defaults to 30. Cannot be more than 30.\n        "
    if ((limit is None) or (limit < 1) or (limit > 30)):
        limit = 30
    stories_found = 0
    while (stories_found < limit):
        soup = get_soup(page=story_type)
        all_rows = self._get_zipped_rows(soup)
        stories = self._build_story(all_rows)
        for story in stories:
            (yield story)
            stories_found += 1
            if (stories_found == limit):
                return

dataset/ETHPy150Open karan/HackerNewsAPI/hn/hn.py HN.get_stories/original