def default(self, urlpath): lses = LastFMSession() lses.authenticate() if urlpath.endswith('.rdf'): # actually do the lookup cherrypy.response.headers['Content-Type'] = 'application/rdf+xml' lses.getLastFMdata(urlpath.rsplit('.rdf')[0]) return lses.createRDFGraph() else: # redirect raise cherrypy.HTTPRedirect(URL_BASE+'mbid/'+urlpath+'.rdf', 303)
def default(self, urlpath): lses = LastFMSession() lses.authenticate() if urlpath.endswith('.rdf'): cherrypy.response.headers['Content-Type'] = 'application/rdf+xml' #lses = artistlookup.LastFMSession(urlpath.rsplit('.rdf')[0]) #lses.authenticate() lses.artistname = urlpath.rsplit('.rdf')[0] lses.getLastFMdata() return lses.createRDFGraph() else: # do a 303 redirect adding '.rdf' to the end lses.artistname = urlpath mbid = lses.getMBID() if mbid: raise cherrypy.HTTPRedirect(URL_BASE+'mbid/'+mbid) else: raise cherrypy.HTTPRedirect(URL_BASE+urlpath+'.rdf', 303)