def addEvent(): if ((request.args.get('description') == None) or (request.args.get('description') == " ") or (request.args.get('description') == '')): desc='sorry no description is provided for this event...' else: desc = request.args.get('description') city_dec = request.args.get('city') city_encoded = str(city_dec.encode('utf-8', 'ignore')) city_decoded = str(city_dec.decode('utf-8', 'ignore')) desc_encoded = str(desc.encode('utf-8', 'ignore')) desc_decoded = str(desc.decode('utf-8', 'ignore')) longitude = request.args.get('longitude') latitude = request.args.get('latitude') start_time = request.args.get('start_time') source = request.args.get('source') artist = request.args.get('artist') mbid = request.args.get('mbid') userid = data_by_email(session['email'])[2] add_event(city_decoded,latitude,longitude,start_time,desc_decoded,source,artist,mbid,userid) return "Ok"
def addEvent(): if ((request.args.get('description') == None) or (request.args.get('description') == " ") or (request.args.get('description') == '')): desc = 'sorry no description is provided for this event...' else: desc = request.args.get('description') city_dec = request.args.get('city') city_encoded = str(city_dec.encode('utf-8', 'ignore')) city_decoded = str(city_dec.decode('utf-8', 'ignore')) desc_encoded = str(desc.encode('utf-8', 'ignore')) desc_decoded = str(desc.decode('utf-8', 'ignore')) longitude = request.args.get('longitude') latitude = request.args.get('latitude') start_time = request.args.get('start_time') source = request.args.get('source') artist = request.args.get('artist') mbid = request.args.get('mbid') userid = data_by_email(session['email'])[2] add_event(city_decoded, latitude, longitude, start_time, desc_decoded, source, artist, mbid, userid) return "Ok"
def profile(): if 'email' not in session: return redirect(url_for('signin')) data = data_by_email(session['email']) oauthType = oauth_type(session['email'])[15:] return render_template('profile.html', username=data[0], location=data[1], userid=data[2][15:] ,oauthType=oauthType)
def profile(): if 'email' not in session: return redirect(url_for('signin')) data = data_by_email(session['email']) oauthType = oauth_type(session['email'])[15:] return render_template('profile.html', username=data[0], location=data[1], userid=data[2][15:], oauthType=oauthType)
def event_vote(eventid,email): data = data_by_email(email) userid = data[2] print eventid , userid sparql = SPARQLWrapper(inserturl) q = """ INSERT DATA { <http://example/"""+ eventid +"""> <http://example/hasbeenVoted> <"""+userid+""">. }""" sparql.setQuery(q) sparql.method = 'POST' sparql.query() return True
def event_vote(eventid,email): data = data_by_email(email) userid = data[2] print eventid , userid sparql = SPARQLWrapper("http://localhost:8080/openrdf-sesame/repositories/1/statements") q = """ INSERT DATA { <http://example/"""+ eventid +"""> <http://example/hasbeenVoted> <"""+userid+""">. }""" sparql.setQuery(q) sparql.method = 'POST' sparql.query() return True
def event_vote(eventid, email): data = data_by_email(email) userid = data[2] print eventid, userid sparql = SPARQLWrapper( "http://localhost:8080/openrdf-sesame/repositories/1/statements") q = """ INSERT DATA { <http://example/""" + eventid + """> <http://example/hasbeenVoted> <""" + userid + """>. }""" sparql.setQuery(q) sparql.method = 'POST' sparql.query() return True
def addEvent(email, artistid): data = data_by_email(email) userid = data[2] location = data[1] eventid = uuid.uuid1() sparql = SPARQLWrapper( "http://localhost:8080/openrdf-sesame/repositories/1/statements") q = """ INSERT DATA { <http://example.com/""" + eventid + """> a <http://example.com/SuggestedEvent>. <http://example.com/""" + userid + """> <http://example/createdEvent> '""" + password + """'. <http://example.com/""" + eventid + """> <http://example/aboutArtist> <http://musicbrainz.org/artist/""" + artistid + """>. <http://example.com/""" + eventid + """> <http://example/eventlocation> \"""" + location + """\". }""" sparql.setQuery(q) sparql.method = 'POST' sparql.query()
def addEvent(email, artistid): data = data_by_email(email) userid = data[2] location = data[1] eventid = uuid.uuid1() sparql = SPARQLWrapper("http://localhost:8080/openrdf-sesame/repositories/1/statements") q = """ INSERT DATA { <http://example.com/"""+ eventid +"""> a <http://example.com/SuggestedEvent>. <http://example.com/"""+ userid +"""> <http://example/createdEvent> '""" + password+"""'. <http://example.com/"""+ eventid +"""> <http://example/aboutArtist> <http://musicbrainz.org/artist/""" +artistid+""">. <http://example.com/"""+ eventid +"""> <http://example/eventlocation> \""""+location+"""\". }""" sparql.setQuery(q) sparql.method = 'POST' sparql.query()