def article_id_list(url_stem, page_no): all_tr = lambda html: html.find_all('tr', class_='table_body') is_not_notice = lambda tag: 'notice' not in tag['class'] get_id = lambda tag: tag.find('td', class_='id').text.strip() return base.article_no_list( url_stem, {'page': str(page_no)}, pipe(all_tr, cfilter(is_not_notice), cmap(get_id), list))
def article_no_list(gall_id, page_no): html2no_list = \ pipe(lambda html:html.find_all('td', class_='gall_num'), cfilter(lambda tag:tag.text != '공지'), cmap(lambda tag:tag.text), list) return base.article_no_list(DC_LIST_STEM, { 'id': gall_id, 'page': str(page_no) }, html2no_list)
def article_no_list(board_name, page_no, category): return base.article_no_list( INSTIZ_LIST_STEM, {'id':board_name, 'page':str(page_no), 'category':str(category)}, pipe(lambda html:html.find_all('td', class_='listno'), cmap(lambda tag:tag.find('a')), cfilter(lambda x:x is not None), cmap(lambda a:a.text), list) )
def article_url_list(board_name, page_no): html2urls = \ pipe(lambda html:html.find('table', class_='tbl_type01') .find_all('tr'), cfilter(lambda tag:tag.find('td').text.isdigit()), cmap(lambda tag:tag.find('a')['href']), list) return base.article_no_list(MLB_LIST_STEM, { 'p': (int(page_no) - 1) * 30 + 1, 'b': board_name, 'm': 'list' }, html2urls)
def article_no_list(board_name, page_no, category=''): html2no_list = \ pipe(lambda html: html.find_all('td', class_='eng list_vspace'), list) return base.article_no_list( PPOM_LIST_STEM, {'id':board_name, 'page':str(page_no), 'category':str(category)}, pipe(lambda html: html.find_all('td', class_='eng list_vspace'), cfilter(lambda tag:tag.get('nowrap') == None), cfilter(lambda tag:tag.text.isdigit()), cmap(lambda tag:tag.text), list) )