-
-
Save johtani/657df4dcfa7c31a86575760e23b64f7d to your computer and use it in GitHub Desktop.
QR code for reception of Meetup event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
</head> | |
<body> | |
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> | |
<script type="text/javascript" src="jquery.qrcode.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('p').text(getParam()); | |
getMemberId(); | |
}); | |
function displayQRCode(data) { | |
displayMemberInfo(data); | |
$('#qrcode').qrcode({width: 128,height: 128, text:createGoogleFormURL(data)}); | |
} | |
function createGoogleFormURL(data) { | |
var obj = { | |
"entry.1744035444" : data.id, | |
"entry.2031666715" : data.name | |
}; | |
return "https://docs.google.com/forms/d/e/<GOOGLE_FORM_ID>/viewform?" + $.param(obj); | |
} | |
function getMemberId() { | |
$.getJSON('https://api.meetup.com/2/member/self/?only=id,name&access_token='+ getToken(), displayQRCode); | |
} | |
function displayMemberInfo(data) { | |
$('ol').append("<li>id: " + data.id + "</li>"); | |
$('ol').append("<li>name: " + data.name + "</li>"); | |
} | |
function getToken() { | |
var url = location.hash; | |
var spparams = url.split("&"); | |
var token = ''; | |
$.each(spparams, function(i, val) { | |
$('ul').append("<li>" + i + ":" + val + "</li>"); | |
var params = val.split("="); | |
if (params[0] == "#access_token") { | |
token = params[1]; | |
} | |
}); | |
return token; | |
} | |
function getParam() { | |
var url = location.hash; | |
return url; | |
} | |
</script> | |
<!-- | |
<p></p> | |
<ul> | |
</ul> | |
<ol> | |
</ol> | |
--> | |
<hr/> | |
<a href="<MEETUP_EVENT_LINK>" target="_blank">マルマル勉強会</a><br/> | |
受付用のQRコードです。<br/> | |
当日は、19時00分開場、19時30分セッション開始を予定しています。 | |
受付にて提示をお願いします。<hr/> | |
<div id="qrcode"></div> | |
<hr/> | |
開場は19時00分を予定しております。<br/> | |
その他、場所などの詳細については、<a href="<MEETUP_EVENT_LINK>" target="_blank">マルマル勉強会</a><br/>ページをご覧ください。 | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment