def fetch_items(self, category, **kwargs):
from_date = kwargs['<STR_LIT>']<EOL>logger.info("<STR_LIT>",<EOL>self.url, self.channel, str(from_date))<EOL>fetching = True<EOL>page = <NUM_LIT:0><EOL>nposts = <NUM_LIT:0><EOL>since = int(from_date.timestamp() * <NUM_LIT:1000>)<EOL>while fetching:<EOL><INDENT>raw_posts = self.client.posts(self.channel, page=page)<EOL>posts_before = nposts<EOL>for post in self._parse_posts(raw_posts):<EOL><INDENT>if post['<STR_LIT>'] < since:<EOL><INDENT>fetching = False<EOL>break<EOL><DEDENT>user_id = post['<STR_LIT>']<EOL>user = self._get_or_fetch_user(user_id)<EOL>post['<STR_LIT>'] = user<EOL>yield post<EOL>nposts += <NUM_LIT:1><EOL><DEDENT>if fetching:<EOL><INDENT>if posts_before == nposts:<EOL><INDENT>fetching = False<EOL><DEDENT>else:<EOL><INDENT>page += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>logger.info("<STR_LIT>", nposts)<EOL>
Fetch the messages.

        :param category: the category of items to fetch
        :param kwargs: backend arguments

        :returns: a generator of items