示例#1
0
def repeat(request,artist_id=None):
	h=History(name=artist_id,user=request.user,hist_date=timezone.now())
	h.save()
	v,z=demo_script(artist_id)
	e=v['toptracks']
	m=z['similarartists']
	return render_to_response('search.html',{'s':m,'k':e,'full_name':request.user.username}, context_instance=RequestContext(request))
示例#2
0
def game(request):

    artist_name = request.POST.get("username", "")

    if artist_name is not "":

        h = History(name=artist_name, user=request.user, hist_date=timezone.now())
        h.save()

        try:
            v, z = demo_script(artist_name)
            e = v["toptracks"]
            m = z["similarartists"]
        except:
            return HttpResponse("error in parsing")

        return render_to_response(
            "search.html",
            {"s": m, "k": e, "full_name": request.user.username},
            context_instance=RequestContext(request),
        )

    else:
        return render_to_response(
            "search.html", {"full_name": request.user.username}, context_instance=RequestContext(request)
        )
示例#3
0
def repeat(request, artist_id=None):
    h = History(name=artist_id, user=request.user, hist_date=timezone.now())
    h.save()
    v, z = demo_script(artist_name)
    e = v["toptracks"]
    m = z["similarartists"]
    return render_to_response(
        "search.html", {"s": m, "k": e, "full_name": request.user.username}, context_instance=RequestContext(request)
    )
示例#4
0
def game(request):
	
	artist_name=request.POST.get('username','')
	
	if artist_name is not '':
		
		h=History(name=artist_name,user=request.user,hist_date=timezone.now())
		h.save()
	
		try:
			v,z=demo_script(artist_name)
			e=v['toptracks']
			m=z['similarartists']
		except:
			return HttpResponse('error in parsing')
		
		return render_to_response('search.html',{'s':m,'k':e,'full_name':request.user.username}, context_instance=RequestContext(request))
		
	else:
		return  render_to_response('search.html',{'full_name':request.user.username},context_instance=RequestContext(request))