Beispiel #1
0
def jpopasia(q_query, raw_query, page):
	'''
	Note: Must be activated in config
	'''
	results = []
	j = getBeatifulXML("http://www.jpopasia.com/search/?q=%s" % q_query)
	for link in j.find("div", **{"class" : "content box"}).findAll("a", href= re.compile( "^" + re.escape("http://www.jpopasia.com/group") ) ):
		# Now we have a link to all of the content
		p = getBeatifulXML(link['href'])
		results.append({
			"style" : "jpopasia music fullscreen",
			"title" : p.find("title"),
			"url" : link['href'],
			"display_url" : link['href'],
			"snippet" : p.find(**{"class" : "c66" }).find("div", **{"class" : "content box"})
		})
	return results
Beispiel #2
0
def websiteSnippetWidget(c):
	import engine
	j = engine.getBeatifulXML(c[0])
	if len(c) == 3:
		w = c[2]
	else:
		w = "%s"
	x = ''
	for i in c[1]:
		x += j.findAll(**i)[0].prettify()
	return w % x