def get_recent_matches(session, init_url, from_timestamp, limit):
if not from_timestamp:<EOL><INDENT>from_timestamp = datetime.datetime.now() - datetime.timedelta(days=<NUM_LIT:1>)<EOL><DEDENT>matches = []<EOL>page_id = <NUM_LIT:0><EOL>done = False<EOL>while not done and page_id < MAX_MATCH_PAGE_ID:<EOL><INDENT>url = '<STR_LIT>'.format(init_url, page_id)<EOL>parsed = make_scrape_request(session, url)<EOL>for row in parsed.find('<STR_LIT>').find_all('<STR_LIT>')[<NUM_LIT:1>:]:<EOL><INDENT>cols = row.find_all('<STR_LIT>')<EOL>played_at = dateparser.parse(cols[<NUM_LIT:2>].text)<EOL>match_id = int(cols[<NUM_LIT:5>].find('<STR_LIT:a>').text[<NUM_LIT:1>:])<EOL>has_rec = cols[<NUM_LIT:6>].find('<STR_LIT:a>').find('<STR_LIT>')<EOL>if played_at < from_timestamp or (limit and len(matches) == limit):<EOL><INDENT>done = True<EOL>break<EOL><DEDENT>if not has_rec:<EOL><INDENT>continue<EOL><DEDENT>matches.append({<EOL>'<STR_LIT>': played_at,<EOL>'<STR_LIT>': match_id<EOL>})<EOL><DEDENT>if not matches:<EOL><INDENT>break<EOL><DEDENT>page_id += <NUM_LIT:1><EOL><DEDENT>return matches<EOL>
Get recently played user matches.