Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(6)  |  Derive(0)  |  Import(3)

src/m/a/madcow-HEAD/contrib/django-memebot/gruntle/memebot/scanner/imgur.py   madcow(Download)
"""Extract image from gallery view of imgur links, but grab the title on the way"""
 
from gruntle.memebot.utils.browser import render_node, strip_site_name
from gruntle.memebot.utils.browser import decode_entities
from gruntle.memebot.scanner.image import ImageScanner
        title = None
        with trapped:
            title = strip_site_name(render_node(soup.head.title), response.url)
 
        with trapped:

src/m/a/madcow-HEAD/contrib/django-memebot/gruntle/memebot/scanner/youtube.py   madcow(Download)
from gruntle.memebot.scanner import Scanner, ScanResult
from gruntle.memebot.exceptions import InvalidContent, trapped
from gruntle.memebot.utils.browser import render_node, strip_site_name
 
class YouTubeScanner(Scanner):
            soup = response.data
            with trapped:
                title = strip_site_name(render_node(soup.head.title), response.url)
            if self.extra_attr:
                desc = soup.find('div', id='watch-description-clip')
                        name, parent, tag, key, val, multi = row
                        node = parent.find(tag, **{key: val})
                        attr[name] = [render_node(s) for s in node(multi)] if multi else render_node(node)
 
        return ScanResult(response=response,

src/m/a/madcow-HEAD/contrib/django-memebot/gruntle/memebot/scanner/html.py   madcow(Download)
from gruntle.memebot.exceptions import InvalidContent, trapped
from gruntle.memebot.utils import text, browser
from gruntle.memebot.utils.browser import render_node, strip_site_name
from django.conf import settings
 
 
        with trapped:
            title = strip_site_name(render_node(soup.head.title), response.url)
 
        with trapped:
        # the front of it.
        if blocks:
            article = browser.render_node(max(blocks)[1])
            words = article[:self.summary_size].split()
            if len(article) > self.summary_size: