def process_ep(self, ep): if self.options.verbose: print ep.id, ep.name meta = scrapevideo(ep.host_url) # print ep.host_url # print meta['description'] description = html_to_markdown(meta['description']) ep.description = description title = html_to_markdown(meta['title']) if ep.name <> title: print ep.host_url print "veyepar:\t%s" % (ep.name, ) print " vimeo:\t%s" % (title, ) print ep.save() ret = None return ret
def process_ep(self, ep): if self.options.verbose: print ep.id, ep.name meta = scrapevideo(ep.host_url) # print ep.host_url # print meta['description'] description = html_to_markdown(meta['description']) ep.description = description title = html_to_markdown(meta['title']) if ep.name <> title: print ep.host_url print "veyepar:\t%s" %( ep.name, ) print " vimeo:\t%s" %( title, ) print ep.save() ret = None return ret
def main(): vs = get_page("http://vimeo.com/api/v2/pydata/videos.json?page=1") vs += get_page("http://vimeo.com/api/v2/pydata/videos.json?page=2") vs = vs[:35] print(len(vs)) for v in vs: title = v['title'] # print title es = Episode.objects.filter(show__slug="pydata_sv_2013", name=title) if len(es) != 1: print(title) print(v['url']) print() else: e=es[0] e.host_url = v['url'] e.description = html_to_markdown(v['description']) e.save()
def main(): vs = get_page("http://vimeo.com/api/v2/pydata/videos.json?page=1") vs += get_page("http://vimeo.com/api/v2/pydata/videos.json?page=2") vs = vs[:35] print(len(vs)) for v in vs: title = v['title'] # print title es = Episode.objects.filter(show__slug="pydata_sv_2013", name=title) if len(es) != 1: print(title) print(v['url']) print() else: e = es[0] e.host_url = v['url'] e.description = html_to_markdown(v['description']) e.save()
def test_html_to_markdown(): """Test html_to_markdown""" assert (html_to_markdown('<p>this is <b>html</b>!</p>') == u'this is **html**!')
def test_html_to_markdown(): """Test html_to_markdown""" eq_(html_to_markdown('<p>this is <b>html</b>!</p>'), u'this is **html**!')
def test_html_to_markdown(): """Test html_to_markdown""" assert ( html_to_markdown('<p>this is <b>html</b>!</p>') == u'this is **html**!' )