정미나닷컴
[Java] 자바 SNS 연동 본문
<script type="text/javascript">
// 트위터
function sendTwitter(msg, url){
var href = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
var a = window.open(href, 'twitter', '');
if( a ){
a.focus();
}
}
// 페이스북
function sendFaceBook(msg, url){
var href = "http://www.facebook.com/sharer.php?u=" + url + "&t=" + encodeURIComponent(msg);
var a = window.open(href, 'facebook', '');
if( a ){
a.focus();
}
}
// 미투데이
function sendMe2Day(msg, url, tag){
var href = "http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(msg) + " " + encodeURIComponent(url) + "&new_post[tags]=" + encodeURIComponent(tag);
var a = window.open(href, 'me2Day', '');
if( a ){
a.focus();
}
}
// 요즘
function sendYozmDaum(link, prefix, parameter){
var href = "http://yozm.daum.net/api/popup/prePost?sourceid=54&link=" + encodeURIComponent(link) + "&prefix=" + encodeURIComponent(prefix) + "¶meter=" + encodeURIComponent(parameter);
var a = window.open(href, 'yozm', 'width=466, height=356');
if( a ){
a.focus();
}
}
// C로그
function sendClog(link, title, thumbnail, summary, writer){
var href = "http://csp.cyworld.com/bi/bi_recommend_pop.php?url=" + encodeURIComponent(link) + "&thumbnail=" + encodeURIComponent(thumbnail) + "&summary=" + encodeURIComponent(summary) + "&writer=" + encodeURIComponent(writer);
var a = window.open(href, 'clog', 'width=400, height=364, scrollbars=no, resizable=no');
if( a ){
a.focus();
}
}
</script>
<a href="#" onclick="sendTwitter('표시메시지', '게시글 url');return false;">트위터</a>
<a href="#" onclick="sendFaceBook('표시메시지', '게시글 url');return false;">페이스북</a>
<a href="#" onclick="sendMe2Day('표시메시지', '게시글 url', '태그1,태그2,태그3');return false;">미투데이</a>
<a href="#" onclick="sendYozmDaum('게시글 url','표시메시지','표시메시지');return false;">요즘</a>
<a href="#" onclick="sendClog('게시글 url', '게시글 제목', '썸네일 url', '글요약', '글쓴이');return false;">C로그</a>
// 트위터
function sendTwitter(msg, url){
var href = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
var a = window.open(href, 'twitter', '');
if( a ){
a.focus();
}
}
// 페이스북
function sendFaceBook(msg, url){
var href = "http://www.facebook.com/sharer.php?u=" + url + "&t=" + encodeURIComponent(msg);
var a = window.open(href, 'facebook', '');
if( a ){
a.focus();
}
}
// 미투데이
function sendMe2Day(msg, url, tag){
var href = "http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(msg) + " " + encodeURIComponent(url) + "&new_post[tags]=" + encodeURIComponent(tag);
var a = window.open(href, 'me2Day', '');
if( a ){
a.focus();
}
}
// 요즘
function sendYozmDaum(link, prefix, parameter){
var href = "http://yozm.daum.net/api/popup/prePost?sourceid=54&link=" + encodeURIComponent(link) + "&prefix=" + encodeURIComponent(prefix) + "¶meter=" + encodeURIComponent(parameter);
var a = window.open(href, 'yozm', 'width=466, height=356');
if( a ){
a.focus();
}
}
// C로그
function sendClog(link, title, thumbnail, summary, writer){
var href = "http://csp.cyworld.com/bi/bi_recommend_pop.php?url=" + encodeURIComponent(link) + "&thumbnail=" + encodeURIComponent(thumbnail) + "&summary=" + encodeURIComponent(summary) + "&writer=" + encodeURIComponent(writer);
var a = window.open(href, 'clog', 'width=400, height=364, scrollbars=no, resizable=no');
if( a ){
a.focus();
}
}
</script>
<a href="#" onclick="sendTwitter('표시메시지', '게시글 url');return false;">트위터</a>
<a href="#" onclick="sendFaceBook('표시메시지', '게시글 url');return false;">페이스북</a>
<a href="#" onclick="sendMe2Day('표시메시지', '게시글 url', '태그1,태그2,태그3');return false;">미투데이</a>
<a href="#" onclick="sendYozmDaum('게시글 url','표시메시지','표시메시지');return false;">요즘</a>
<a href="#" onclick="sendClog('게시글 url', '게시글 제목', '썸네일 url', '글요약', '글쓴이');return false;">C로그</a>
'IT' 카테고리의 다른 글
[Windows] Windows 7에 IIS 설치 (0) | 2011.03.22 |
---|---|
[HTML5] HTML5 개요 (0) | 2011.03.10 |
[Oracle] 오라클 집계 함수 (0) | 2011.01.25 |
[Oracle] 오라클 DECODE와 CASE (0) | 2011.01.12 |
[Browser] SNS 웹브라우저 RockMelt (8) | 2011.01.06 |