Skip to content

Instantly share code, notes, and snippets.

@romeoh
Created July 31, 2013 08:42
Show Gist options
  • Save romeoh/6120413 to your computer and use it in GitHub Desktop.
Save romeoh/6120413 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://opengraphprotocol.org/schema/"
xmlns:fb="http://www.facebook.com/2008/fbml"
lang="ko"
xml:lang="ko" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="http://www.vectorstock.com/i/composite/85,73/yesno-white-buttons-vector-98573.jpg" type="image/x-icon" />
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<link rel="image_src" href="http://www.vectorstock.com/i/composite/85,73/yesno-white-buttons-vector-98573.jpg"/>
<meta property="og:site_name" content="예스/노 게임"/>
<meta property="og:title" content="예스/노 게임"/>
<meta property="og:type" content="activity"/>
<meta property="og:url" content="http://wnodxqkmrlpvafitcb.ptlovestory.com/"/>
<meta property="og:image" content="http://www.vectorstock.com/i/composite/85,73/yesno-white-buttons-vector-98573.jpg"/>
<meta property="fb:app_id" content="138331149577737"/>
<meta name="description" content="예스/노 게임"/>
<base target="_top" />
<title>예스/노 게임 | 예스/노 게임</title>
<link type="text/css" rel="stylesheet" media="all" href="/sites/default/files/css/css_a3c4e40dc81e7caf2ce8bfc8070f1de7.css" />
<script type="text/javascript" src="/sites/default/files/js/js_ea73f7c22fc910aa3cfa7c3a60d9b598.js">
</script>
<script type="text/javascript">
<
!-- //--><![CDATA[//><!--
jQuery.extend(Drupal.settings, {"basePath": "/"});
//--><!]]>
</script>
</head>
<body>
<div id="wrapper">
<div id="main-header">
</div>
<div id="main-content">
<div id="header">
<div class="ads">
<iframe width='728' height='90' frameborder='no' framespacing='0' scrolling='no' src='http://wnodxqkmrlpvafitcb.ptlovestory.com/ads/cubics/ifriendsinterview-leaderboard.html'></iframe>
</div>
</div>
<div id="content">
<div class="label-header">
<a href="http://wnodxqkmrlpvafitcb.ptlovestory.com/">예스/노 게임</a>
<fb:like href="http://www.facebook.com/LOLpicture" layout="button_count" show_faces="true" width="50"></fb:like>
</div>
<style type="text/css">
.choices {border: 1px black solid; text-align: center; padding: 20px 5px; width: 140px; overflow: hidden; float: left; cursor: pointer; }
.choices .answer { font-size: 150%; margin: 10px 0; font-weight: bold; }
#choice0 {margin-right: 6px; border: 1px #3399FF solid; background: #DDEEFF; }
#choice0:hover { background: #B3D9FF; }
#choice1 {margin-right: 6px; border: 1px #FF0000 solid; background: #FFDFDF; }
#choice1:hover { background: #FFCECE; }
#choice2 { border: 1px #339900 solid; background: #E6FFD9; }
#choice2:hover { background: #CBFFAE; }
body { width: 800px; }
#content-left{ width: 480px; }
</style>
<script type="text/javascript">
var app_loaded = false;
var is_waiting = true;
var time_to_wait = 20;
var i = -1;
var answered = 0;
var max_answered = 20;
var allowPublish = true;
var post_limit = 5;
var reloading = false;
var choices = ["✓예✓", "×아니오×", "아마도??"];
var choiceImages = ["http://yesnogame.s3.amazonaws.com/yes.png", "http://yesnogame.s3.amazonaws.com/no.png", "http://yesnogame.s3.amazonaws.com/questionmark.png"];
var yesno_publish_text = "!user의 담벼락에 !result에 응답하기 위해서는 여기를 클릭하십시오.";
var totalCoin = 0;
var answers = [{"id": "iyesno2","uid": "100001587301492","name": "Keyjey Sung","question": " @name가 콘서트 동안에 춤추려고 무대로 뛰어올라갈 배짱이 있습니까?","choice": 2}, {"id": "iyesno1","uid": "100000996248170","name": "Connie Sung","question": "@name 님과의 결혼을 상상한 적이 있습니까?","choice": 0}, {"id": "iyesno0","uid": "1086877332","name": "Naruemol Chotivichit","question": "@name가 페이스북에 중독되었다고 생각하나요?","choice": 0}];
$(document).bind('fb.checklogin', function() {
getFriends();
updateCoins(0);
});
function showResults() {
if (!is_waiting) {
$('#app-loading').hide();
$('#app-result').slideDown();
updateLinks();
showNextQuestion();
}
is_waiting = false;
}
function showNextQuestion() {
//if no more question, go to invite page
if (data.questions.length == 0 || data.friends.length == 0) {
getFriends();
} else if (i >= data.questions.length - 1) {
if (!reloading) {
window.location.reload();
reloading = true;
}
} else {
i += 1;
//get data with counter i
var user = data.friends[i % data.friends.length]
var question = data.questions[i].replace(/@name/gi, user.name);
$('#question').html(question);
$('#question-image').attr('src', 'https://graph.facebook.com/' + user.id + '/picture?type=square');
for (var k = 0; k < 3; k++) {
$("#choice" + k).html(yesno_publish_text.replace("!result", "<div class='answer'>" + choices[k] + "</div>").replace("!user", user.name));
}
if (i % 2 == 0) {
$('#lifestreet1').attr('src', $('#lifestreet1').attr('src'));
$('#lifestreet2').attr('src', $('#lifestreet2').attr('src'));
$('#lifestreet3').attr('src', $('#lifestreet3').attr('src'));
}
}
}
function answerQuestion(index) {
var image = choiceImages[index];
var user = data.friends[i % data.friends.length]
var question_original = data.questions[i];
var question = question_original.replace(/@name/gi, user.name);
var feed = {"method": "feed","name": "예스/노 게임","href": "http://apps.facebook.com/wnodxqkmrlpvafitcb/","link": "http://apps.facebook.com/wnodxqkmrlpvafitcb/","picture": "http://www.vectorstock.com/i/composite/85,73/yesno-white-buttons-vector-98573.jpg","caption": "{*actor*}의 응답:","description": "\x26nbsp;","properties": [{"text": "답변보기","href": "http://apps.facebook.com/wnodxqkmrlpvafitcb/"}]};
feed.name = question;
feed.description = feed.caption.replace("{*actor*}", "");
feed.caption = "";
delete feed.properties;
//feed.picture = 'http://graph.facebook.com/100002747730445/picture?type=normal';
var auto = true;
if (answered < post_limit) {
publishfeed(feed, user.id, allowPublish, function(response) {
$.get("/ajax/publish");
if (response && response['error'] && (response['error']['message'] == '(#341) Feed action request limit reached' || response['error']['message'] == "(#200) The user hasn't authorized the application to perform this action"))
allowPublish = false;
});
answered++;
} else {
FB.ui({
method: 'apprequests',
message: question,
to: user.id,
data: 'yesno'
}, function(data) {
if (data) {
$.get("/ajax/apprequest");
}
});
}
$('#question-message').val('');
var item = {player_uid: "100002747730445",name: "",friend_uid: user.id,question: question_original,choice: index};
updateCoins(1, item);
showNextQuestion();
}
function sendrequest() {
var friend_uids = [];
for (var i = 0; i < data.friends.length; i++) {
var friend = data.friends[i];
friend_uids.push(friend.id);
}
if (friend_uids.length) {
FB.ui({
method: 'apprequests',
message: ' 가(이) 방금 막 당신에대한 질문에 답했습니다.',
to: friend_uids,
data: 'yesno'
}, function(data) {
if (data) {
$.get("/ajax/allrequest");
}
});
}
}
function getFriends() {
i = -1;
app_loaded = true;
is_waiting = true;
setTimeout(function() {
showResults();
}, time_to_wait * 1000);
$('#app-result').hide();
$('#app-loading').slideDown();
$.ajax({
url: "/ajax/friend",
dataType: "json",
success: function(_data) {
if (debug)
alert(_data);
if (_data) {
data = _data;
showResults();
sendrequest();
}
},
error: function(jqXHR, textStatus, errorThrown) {
if (debug) {
alert(textStatus);
}
}
});
}
function unlock(index) {
if (totalCoin >= 10) {
var user_name = "";
var target_uid = answers[index]['uid'];
var target_name = answers[index]['name'];
var question = answers[index]['question'].replace(/@name/gi, user_name);
var choice = answers[index]['choice'];
var id = answers[index]['id'];
var image = choiceImages[choice];
updateCoins(-10);
var feed = {"method": "feed","name": "예스/노 게임","href": "http://apps.facebook.com/wnodxqkmrlpvafitcb/","link": "http://apps.facebook.com/wnodxqkmrlpvafitcb/","picture": "http://www.vectorstock.com/i/composite/85,73/yesno-white-buttons-vector-98573.jpg","caption": "{*actor*}의 응답:","description": "\x26nbsp;","properties": [{"text": "답변보기","href": "http://apps.facebook.com/wnodxqkmrlpvafitcb/"}]};
feed.name = question;
feed.picture = image;
feed.caption = choices[choice];
feed.properties = [{text: choices[choice],href: feed.href}];
if (target_name) {
feed.caption = "@user의 응답:".replace("@user", target_name);
}
$('#unlock-' + index).removeClass('hidden');
$('#lock-' + index).addClass('hidden');
publishfeed(feed, null, true);
$.get("/ajax/unlock", {id: id});
} else {
$.facebox({div: '#not-enough-coin'});
}
}
function updateCoins(inc, item) {
totalCoin = totalCoin + inc;
var desc = "당신은 이미 !total 을 적립하셨습니다. 당신이 답변해준 질문 마다 1개의 동전을 적립할 수 있습니다.".replace("!total", '<span class="bold reddish big">' + totalCoin + '</span>');
$('#coin-desc').html(desc);
$('#coin-warning').html(desc);
if (inc && data) {
$.get("/ajax/add", item);
}
}
</script>
<div id="not-enough-coin" class="hidden">
<div class="center">
<p><strong>당신은 충분한 동전이 없습니다.</strong></p>
<p id="coin-warning"></p>
</div>
</div>
<div id="iyesno">
<div class="notice center">
<p id="coin-desc" class="center"></p>
<div>
당신의 10각 대답. </div>
</div>
<div class="ads">
<iframe id="lifestreet1" width='728' height='90' frameborder='no' framespacing='0' scrolling='no' src='http://wnodxqkmrlpvafitcb.ptlovestory.com/ads/lt/iyesno-33095.html'></iframe>
</div>
<div id="content-left">
<div id="app-loading" class="center hidden">
<p><img src="/files/images/loading-long.gif"/></p>
<p>로딩중</p>
<iframe id="lifestreet2" width='300' height='250' frameborder='no' framespacing='0' scrolling='no' src='http://wnodxqkmrlpvafitcb.ptlovestory.com/ads/lt/iyesno-33406.html'></iframe>
</div>
<div id="app-result" class="hidden">
<table width="480" cellpadding="0" cellspacing="0">
<tr>
<td width="60" valign="top">
<div style="max-height: 100px; overflow: hidden;"><img id="question-image" src="/files/images/loading.gif"/></div>
</td>
<td valign="top">
<h1 id="question" style="line-height: 150%"></h1>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<div style="margin: 5px 0;">
<div id="choice0" class="choices" onclick="answerQuestion(0);"></div>
<div id="choice1" class="choices" onclick="answerQuestion(1);"></div>
<div id="choice2" class="choices" onclick="answerQuestion(2);"></div>
<div class="clearfix"></div>
</div>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<div class="center">
<iframe id="lifestreet3" width='468' height='60' frameborder='no' framespacing='0' scrolling='no' src='http://wnodxqkmrlpvafitcb.ptlovestory.com/ads/lt/iyesno-29459.html'></iframe>
</div>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<div class="center"><input id="question-skip" onclick="showNextQuestion()" type="button" value="건너뛰기" class="inputsubmit inputdisabled"/></div>
</td>
</tr>
</table>
</div>
</div>
<div id="content-right">
<div id="app-unlock">
<div class="ads">
<script type="text/javascript">
<
!--
google_ad_client = "ca-pub-5178531656513845";
/* iyesno-rectangle */
google_ad_slot = "8305900609";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div class="label-header">당신에 대해 대답하라</div>
<table width="100%"><tr>
<td width="60" valign="top"><img src="https://graph.facebook.com/100001587301492/picture"/></td>
<td>Keyjey Sung</td>
</tr></table>
<div class="tall block" id="title-0">
<span class="blue"></span>가 콘서트 동안에 춤추려고 무대로 뛰어올라갈 배짱이 있습니까? </div>
<div id="unlock-0" class="block hidden">
<img src="http://yesnogame.s3.amazonaws.com/questionmark.png" style="vertical-align: middle; margin-right: 10px; "/>
<span class="quote-outer"><span class="quote-inner reddish">
아마도?? </span></span>
</div>
<div id="lock-0" class="">
<p>10 동전을 위한 <strong>Keyjey Sung</strong>의 대답을 찾아라</p>
<input onclick="unlock(0)" type="button" value="잠금 해제와 벽에에 답변을 게시" class="inputsubmit" style="font-size: 90%;"/>
</div>
<hr/>
<table width="100%"><tr>
<td width="60" valign="top"><img src="https://graph.facebook.com/100000996248170/picture"/></td>
<td>Connie Sung</td>
</tr></table>
<div class="tall block" id="title-1">
<span class="blue"></span> 님과의 결혼을 상상한 적이 있습니까? </div>
<div id="unlock-1" class="block hidden">
<img src="http://yesnogame.s3.amazonaws.com/yes.png" style="vertical-align: middle; margin-right: 10px; "/>
<span class="quote-outer"><span class="quote-inner reddish">
✓예✓ </span></span>
</div>
<div id="lock-1" class="">
<p>10 동전을 위한 <strong>Connie Sung</strong>의 대답을 찾아라</p>
<input onclick="unlock(1)" type="button" value="잠금 해제와 벽에에 답변을 게시" class="inputsubmit" style="font-size: 90%;"/>
</div>
<hr/>
<table width="100%"><tr>
<td width="60" valign="top"><img src="https://graph.facebook.com/1086877332/picture"/></td>
<td>Naruemol Chotivichit</td>
</tr></table>
<div class="tall block" id="title-2">
<span class="blue"></span>가 페이스북에 중독되었다고 생각하나요? </div>
<div id="unlock-2" class="block hidden">
<img src="http://yesnogame.s3.amazonaws.com/yes.png" style="vertical-align: middle; margin-right: 10px; "/>
<span class="quote-outer"><span class="quote-inner reddish">
✓예✓ </span></span>
</div>
<div id="lock-2" class="">
<p>10 동전을 위한 <strong>Naruemol Chotivichit</strong>의 대답을 찾아라</p>
<input onclick="unlock(2)" type="button" value="잠금 해제와 벽에에 답변을 게시" class="inputsubmit" style="font-size: 90%;"/>
</div>
<hr/>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
<div id="fb-root"></div>
<script type="text/javascript">
var publish_text = "@name의 담벼락에 포스팅하기";
var fb_loaded = false;
var fb_signedin = false;
var like_prompted = false;
window.fbAsyncInit = function() {
FB.init({appId: '138331149577737',status: true,cookie: true,xfbml: true,oauth: true,frictionlessRequests: true,channelURL: 'http://wnodxqkmrlpvafitcb.ptlovestory.com/channel.html'});
fb_loaded = true;
//FB.Canvas.setAutoResize();
FB.Canvas.setAutoGrow();
$(document).trigger('fb.initialized');
checkLoginStatus();
checkSignedIn();
};
function checkLoginStatus() {
FB.getLoginStatus(function(response) {
if (response && response.authResponse) {
$(document).trigger('fb.checklogin');
} else {
window.location = "http://wnodxqkmrlpvafitcb.ptlovestory.com/?login=true";
// $(document).trigger('fb.checklogin.failed');
}
});
}
function checkSignedIn() {
$(document).trigger('fb.checksignedin');
if (!fb_signedin) {
FB.getLoginStatus(function(response) {
if (response && response.authResponse) {
fb_signedin = true;
$(document).trigger('fb.signedin');
}
});
}
}
function logout() {
FB.logout(function(response) {
window.location.reload();
});
}
function pad(number, length) {
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}
function shareurl(share_url) {
var left = (screen.width / 2) - (600 / 2);
var top = (screen.height / 2) - (400 / 2);
var share_win = window.open('http://www.facebook.com/share.php?u=' + share_url, 'sharer', 'toolbar=0,status=0,resizable=1,width=600,height=400, top=' + top + ',left=' + left);
}
$(document).ready(function() {
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
});
if (top != self) {
top.location.href = "http://wnodxqkmrlpvafitcb.ptlovestory.com/";
}
var callback = "http://wnodxqkmrlpvafitcb.ptlovestory.com/";
var application_id = "138331149577737";
var debug = false;
</script><script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-23549772-11']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</div>
<div id="main-footer">
</div>
</div>
<script type="text/javascript" src="/sites/default/files/js/js_fbc1897cd222ca02b7cff8abad417072.js">
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment