def list(self):
        url = "%s/%s/posts?page=%u&%s" % (utils.url_root, self.author_url,
                                          self.current_page,
                                          utils.selected_languages())
        html_data = http_request.get(url)
        soup_strainer = SoupStrainer("main")
        beautiful_soup = BeautifulSoup(
            html_data,
            soup_strainer,
            convertEntities=BeautifulSoup.HTML_ENTITIES)
        articles = beautiful_soup.findAll("article")
        if articles is None:
            control.directory_end()
            return

        for article in articles:
            utils.add_entry_video(article)

        next_url = "%s?action=list-author&page=%i&author-url=%s" % (
            sys.argv[0], self.current_page + 1,
            urllib.quote_plus(self.author_url))
        utils.add_next_page(beautiful_soup, next_url, self.current_page + 1)

        control.directory_end()
        return
Пример #2
0
    def list(self):
        url = ""
        if not re.match("^https?:", self.event_url):
            url = "%s%s" % (utils.url_root, self.event_url)
        else:
            url = self.event_url

        url = "%s?sort=%s&page=%i&direction=asc&%s" % (
            url, self.sort, self.current_page, utils.selected_languages())

        html_data = http_request.get(url)

        soup_strainer = SoupStrainer("main")
        beautiful_soup = BeautifulSoup(
            html_data,
            soup_strainer,
            convertEntities=BeautifulSoup.HTML_ENTITIES)
        articles = beautiful_soup.findAll("article")
        if articles is None:
            control.directory_end()
            return

        for article in articles:
            utils.add_entry_video(article)

        next_url = "%s?action=list-event&page=%i&sort=%s&event-url=%s" % (
            sys.argv[0], self.current_page + 1,
            urllib.quote_plus(
                self.sort_method), urllib.quote_plus(self.event_url))
        utils.add_next_page(beautiful_soup, next_url, self.current_page + 1)

        control.directory_end()
        return
    def list(self):
        url = "%s%s?sort=%s&page=%i&%s" % (
            utils.url_root, self.series_url, self.sort, self.current_page, utils.selected_languages())
        html_data = http_request.get(url)
        print url
        soup_strainer = SoupStrainer("main")
        beautiful_soup = BeautifulSoup(html_data, soup_strainer, convertEntities=BeautifulSoup.HTML_ENTITIES)
        articles = beautiful_soup.findAll("article")
        for article in articles:
            utils.add_entry_video(article)

        next_url = "%s?action=list-series&page=%i&sort=%s&series-url=%s" % (
            sys.argv[0], self.current_page + 1, urllib.quote_plus(self.sort_method), urllib.quote_plus(self.series_url))
        utils.add_next_page(beautiful_soup, next_url, self.current_page + 1)

        control.directory_end()
        return
    def list(self):
        url = "%s%s?sort=%s&page=%i&%s" % (
            utils.url_root, self.series_url, self.sort, self.current_page, utils.selected_languages())
        html_data = http_request.get(url)
        print url
        soup_strainer = SoupStrainer("div", {"class": "tab-content"})
        beautiful_soup = BeautifulSoup(html_data, soup_strainer, convertEntities=BeautifulSoup.HTML_ENTITIES)
        ul_entries = beautiful_soup.find("ul", {"class": "entries"})
        li_entries = ul_entries.findAll("li")
        for li_entry in li_entries:
            utils.add_entry_video(li_entry)

        next_url = "%s?action=list-series&page=%i&sort=%s&series-url=%s" % (
            sys.argv[0], self.current_page + 1, urllib.quote_plus(self.sort_method), urllib.quote_plus(self.series_url))
        utils.add_next_page(beautiful_soup, next_url, self.current_page + 1)

        control.directory_end()
        return
    def list(self):
        url = "%s/%s/posts?page=%u&%s" % (
            utils.url_root, self.author_url, self.current_page, utils.selected_languages())
        html_data = http_request.get(url)
        soup_strainer = SoupStrainer("div", {"class": "user-content"})
        beautiful_soup = BeautifulSoup(html_data, soup_strainer, convertEntities=BeautifulSoup.HTML_ENTITIES)

        ul_entries = beautiful_soup.find("ul", {"class": "entries"})
        if ul_entries is None:
            control.directory_end()
            return

        li_entries = ul_entries.findAll("li")
        for li_entry in li_entries:
            utils.add_entry_video(li_entry)

        next_url = "%s?action=list-author&page=%i&author-url=%s" % (
            sys.argv[0], self.current_page + 1, urllib.quote_plus(self.author_url))
        utils.add_next_page(beautiful_soup, next_url, self.current_page + 1)

        control.directory_end()
        return