Skip to content

Instantly share code, notes, and snippets.

@johtani johtani/qrcode.html Secret
Created Jun 19, 2019

Embed
What would you like to do?
QR code for reception of Meetup event
<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
You can’t perform that action at this time.