네이버 밴드 공유



function band_share(data) {

    var a_store='itms-apps://itunes.apple.com/app/id542613198?mt=8';

    var g_store='market://details?id=com.nhn.android.band';

    var a_proto='bandapp://';

    var g_proto='scheme=bandapp;package=com.nhn.android.band';

// 밴드 공유 내용

var param = 'create/post?text=' + data.content;

var method = 'popup';

var _data_url = encodeURIComponent(data.url);

var _data_content = encodeURIComponent(data.content);

// body뒤에 제목, 주소를 넣어야 메타이미지 나타남

window.open( "http://www.band.us/plugin/share?body=" + _data_content +encodeURIComponent("\n")+ _data_url +"&route=" + _data_url, "share_band", "width=410, height=540, resizable=no");

}

'Programming > SNS' 카테고리의 다른 글

[Facebook] 메타태그 크롤링  (0) 2016.10.27

정규표현식으로 콤마 제거




/* array comma 제거 */

function util_uncomma(str) {

    str = String(str);

    return str.replace(/[^\d]+/g, '');

}


정규표현식으로 공백 제거




/* 공백 제거 */

function util_trim(str) {

return ifnull(str).replace(/\s/g,"");

}

문장내에 HASH TAG, AT을 a tag로 변환




/* 문장안에 hashtag, at을 a tag 로 변환 */

function util_convert_to_hash_tag(str) {

var inputString = str;

inputString = inputString.replace(/#[^#\s]+|@[^@\s]+/gm, function (tag){

return (tag.indexOf('#')== 0) ? '<a href="' + context + '/search/tags/?keyword=' + encodeURIComponent(tag.replace('#','')) + '">' + tag + '</a>' : '<a href="' + context + '/' + tag.replace('@','') + '">' + tag + '</a>';

});

return inputString;

}


정규표현식으로 코딩해본것임

+ Recent posts