Skip to content

Instantly share code, notes, and snippets.

@smalljam
Created November 26, 2012 15:32
Show Gist options
  • Save smalljam/4148805 to your computer and use it in GitHub Desktop.
Save smalljam/4148805 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8>
<script>
//https://raw.github.com/dankogai/js-base64/master/base64.js
(function(a){"use strict";var b;typeof module!="undefined"&&module.exports&&(b=require("buffer").Buffer);var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=function(a){for(var b={},c=0,d=a.length;d>c;c++)b[a.charAt(c)]=c;return b}(c),e=String.fromCharCode,f=function(a){var b=a.charCodeAt(0);return 128>b?a:2048>b?e(192|b>>>6)+e(128|b&63):e(224|b>>>12&15)+e(128|b>>>6&63)+e(128|b&63)},g=function(a){return a.replace(/[^\x00-\x7F]/g,f)},h=function(a){var b=[0,2,1][a.length%3],d=a.charCodeAt(0)<<16|(a.length>1?a.charCodeAt(1):0)<<8|(a.length>2?a.charCodeAt(2):0),e=[c.charAt(d>>>18),c.charAt(d>>>12&63),b>=2?"=":c.charAt(d>>>6&63),b>=1?"=":c.charAt(d&63)];return e.join("")},i=a.btoa||function(a){return a.replace(/[\s\S]{1,3}/g,h)},j=b?function(a){return new b(a).toString("base64")}:function(a){return i(g(a))},k=function(a,b){return b?j(a).replace(/[+\/]/g,function(a){return a=="+"?"-":"_"}):j(a)},l=function(a){return k(a,!0)},m=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}/g,n=function(a){return e(3>a.length?(31&a.charCodeAt(0))<<6|63&a.charCodeAt(1):(15&a.charCodeAt(0))<<12|(63&a.charCodeAt(1))<<6|63&a.charCodeAt(2))},o=function(a){return a.replace(m,n)},p=function(a){var b=a.length,c=b%4,f=(b>0?d[a.charAt(0)]<<18:0)|(b>1?d[a.charAt(1)]<<12:0)|(b>2?d[a.charAt(2)]<<6:0)|(b>3?d[a.charAt(3)]:0),g=[e(f>>>16),e(f>>>8&255),e(f&255)];return g.length-=[0,0,2,1][c],g.join("")},q=a.atob||function(a){return a.replace(/[\s\S]{1,4}/g,p)},r=b?function(a){return new b(a,"base64")+""}:function(a){return o(q(a))},s=function(a){return r(a.replace(/[-_]/g,function(a){return a=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))};if(a.Base64={atob:q,btoa:i,fromBase64:s,toBase64:k,utob:g,encode:k,encodeURI:l,btou:o,decode:s},typeof Object.defineProperty=="function"){var t=function(a){return{value:a,enumerable:!1,writable:!0,configurable:!0}};a.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",t(function(){return s(this)})),Object.defineProperty(String.prototype,"toBase64",t(function(a){return k(this,a)}))}}})(this)
</script>
<body>
<style>
#holder { border: 2px dashed #ccc; width: 100%; height: 50px; margin: 0px auto;}
#holder.hover { border: 2px dashed #333; }
</style>
<div id="holder"></div>
<script>
window.allJSON = {};
var holder = document.getElementById('holder');
holder.ondragover = function () { this.className = 'hover'; return false; };
holder.ondragend = function () { this.className = ''; return false; };
holder.ondrop = function (e) {
this.className = '';
e.preventDefault();
var file = e.dataTransfer.files[0],
reader = new FileReader();
reader.onload = function (event) {
var data = JSON.parse( Base64.decode(event.target.result.replace('data:application/json;base64,', '')) );
allJSON[file.name] = data;
console.log(data);
};
console.log(file.name);
reader.readAsDataURL(file);
return false;
};
</script>
</body>
</html>
@dofordev
Copy link

{
dataMap: {
result: {
BSIC_AC_INFO: {
ACNO: "KEB하나 01030091031-737",
LINK_URL: "",
ICN_URL: "",
INFW_DOMN_URL: "/MAS90A0903.web?dt=20190213130627245",
RSMNY: "6570.0",
AC_NM: "핀크계좌",
AC_RGS_YN: "Y",
PRD_DES_CNTN: "예상 캐시백",
AC_BL: "000000000002024000",
EXTL_URL: "/MAS90B0390.web?RETURN_URL=MYFINNQ&dt=20190213130627245",
SAV_INTR: "10.0",
AGR_YN: "Y",
},
RMSV_INFO: {
PDNM: "습관저금",
PRD_DVCD: "01",
LINK_URL: "/MAS90M1401.web?dt=20190213130627245",
BNF_CNTN: "000000000000000000",
USE_AMT: "000000000000000000",
EXP_YN: "Y",
MAIN_PRD_STCD: "01",
PRD_DES_CNTN: "습관이 돈이 되는",
IUSE_YN: "Y",
},
BNF_TAMT: "000000000003003189",
FNC_GOAL_CD: "04",
LIST_SIZE: 5,
NOITW_PRD_INFO: {
PSNO_IDFR_NO: "2",
TRNM_CHNL_CD: "MA01506C01",
NOITW_OPN_RQ_NO: "",
BRDT: "841031",
ENTP_CI_INFO: "XMXcWyzt4RjrBtCmL9vFEzctQ4bRgS0UEsGp1KGKx92YcCVGMwqR4cKBbSbr34CTGcYoWq0ktwY1UZ0NVzvN5Q==",
},
FINQ_CRD_INFO: {
PDNM: "핀크카드",
PRD_DVCD: "11",
LINK_URL: "/MAS90C0200.web?dt=20190213130625921",
BNF_CNTN: "1.0",
USE_AMT: "",
EXP_YN: "Y",
MAIN_PRD_STCD: "",
PRD_DES_CNTN: "핀크계좌 전용 선불카드",
IUSE_YN: "N",
},
FNC_GOAL_NM: "잔고봐라! 이래도 쓸꺼임?",
LINK_URL: "/MAS90A1103.web",
_BeginLoop_LIST: [
{
CODE_GROUP: "72614",
CODE_NAME: "돈 버는 소비습관 만들기!",
CODE: "01",
},
{
CODE_GROUP: "72614",
CODE_NAME: "스쳐가는 월급잡기",
CODE: "02",
},
{
CODE_GROUP: "72614",
CODE_NAME: "아끼지 말고 습관을 바꾸자",
CODE: "03",
},
{
CODE_GROUP: "72614",
CODE_NAME: "잔고봐라! 이래도 쓸꺼임?",
CODE: "04",
},
{
CODE_GROUP: "72614",
CODE_NAME: "직접입력",
CODE: "99",
},
],
LIST2_SIZE: 5,
LIST1_SIZE: 2,
_BeginLoop_LIST1: [
{
PDNM: "기프티콘",
PRD_DTL_CNTN: "10개 구매",
SORT: 3,
LABEL_TXT: "쇼핑",
ICN_URL: "",
LINK_URL: "/MAS90G1001.web?dt=20190213130627421",
PRD_DVCD: "41",
LINK_TXT: "상세내역",
MAIN_PRD_STCD: "",
PRD_ETC_CNTN: "",
PRD_DES_CNTN: "",
},
{
PDNM: "P2P 투자",
PRD_DTL_CNTN: "가입 완료",
SORT: 10,
LABEL_TXT: "투자",
ICN_URL: "/MAS90A1107.web",
LINK_URL: "https://dpib.finnq.com/",
PRD_DVCD: "0501010001",
LINK_TXT: "상품 보기",
MAIN_PRD_STCD: "01",
PRD_ETC_CNTN: "업데이트 08/08 16:05",
PRD_DES_CNTN: "P2P 소액투자를 시작해 보세요.",
},
],
_BeginLoop_LIST2: [
{
BNR_LINK_URL: "/MAS90F0301.web?WEBVIEW_TYPE=EN&EVNT_NO=0000000102&dt=20190213010626127",
IMG_URL: "/resources/v2/pubs/images/upload/201807041600417248ffae08d26001.png",
TITL: "친구 초대 이벤트",
},
{
BNR_LINK_URL: "/MAS90F0203.web?WEBVIEW_TYPE=EN&EVNT_NO=0000000903&dt=20190213010626127",
IMG_URL: "/resources/v2/pubs/images/upload/201811020957236376a5176866c001.jpg",
TITL: "11번가 이벤트 테스트",
},
{
BNR_LINK_URL: "/MAS90F0203.web?WEBVIEW_TYPE=EN&EVNT_NO=0000000703&dt=20190213010626128",
IMG_URL: "/resources/v2/pubs/images/upload/20180829155358881d653bedbe4001.png",
TITL: "TEST",
},
{
BNR_LINK_URL: "https://pib.finnq.com?WEBVIEW_TYPE=EN&dt=20190213010626128",
IMG_URL: "/resources/v2/pubs/images/upload/201807261546254977a5e9192cc001.png",
TITL: "P2P 투자 Open",
},
{
BNR_LINK_URL: "/MAS90F0401.web?WEBVIEW_TYPE=EN&EVNT_NO=0000000101&dt=20190213010626128",
IMG_URL: "/resources/v2/pubs/images/upload/201805081543489416778cb8cba001.png",
TITL: "최신폰 제휴광고 이벤트",
},
],
},
result_msg: "성공",
EXP_YN: "Y",
result_cd: "100",
IUSE_YN: "Y",
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment