메뉴 건너뛰기

프로그램언어

조회 수 12465 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
PHP 네이버블로그 원격 글쓰기 API 소스

include_once "xmlrpc.inc"; 

function newPost($title, $description, $category) { 
$g_blog_url = "https://api.blog.naver.com/xmlrpc"; 
$user_id = "네이버 아이디"; 
$blogid = "블로그 아이디 = 네이버 아이디와 동일"; 
$password = "글쓰기 API 암호"; 
$publish = true; 
$client = new xmlrpc_client($g_blog_url); 

$client->setSSLVerifyPeer(false); 
$GLOBALS['xmlrpc_internalencoding']='UTF-8'; 

$struct = array( 
'title' => new xmlrpcval($title, "string"), 
'description' => new xmlrpcval($description, "string"), 
'categories' => new xmlrpcval($category, "string") 
); 

$f = new xmlrpcmsg("metaWeblog.newPost", 
array( 
new xmlrpcval($blogid, "string"), 
new xmlrpcval($user_id, "string"), 
new xmlrpcval($password, "string"), 
new xmlrpcval($struct , "struct"), 
new xmlrpcval($publish, "boolean") 
); 

$f->request_charset_encoding = 'UTF-8'; 

return $response = $client->send($f); 

$return = newPost("블로그 제목", "블로그 내용", "블로그 카테고리명"); 

print_r($return); 
?> 

xmlrpc.inc 다운로드 

네이버 글쓰기 API를 활성화 시키시고 작업하시면 됩니다. 

많은 내용들이 구글에 올라와 있습니다만 내용이 너무 복잡하더군요 

그래서 필요한 부분만 올려봅니다. 

수정 및 삭제는 따로 찾아보시면 될듯합니다. 


자세한 내용은 위의 문서를 참고하시면 될듯합니다. 

매번 블로그 로그인 하기 귀찮을때는 요긴하게 쓰입니다. ^^

  1. PHP 네이버블로그 원격 글쓰기 API 소스

    Date2018.02.09 Views12465
    Read More
  2. php 내장함수

    Date2017.03.07 Views17004
    Read More
  3. PHP 날짜/시간 정리

    Date2017.03.07 Views18629
    Read More
  4. PHP 날짜, 시간 관련 함수. date(), mktime()

    Date2017.03.06 Views16707
    Read More
  5. PHP 날짜 함수

    Date2017.04.13 Views17673
    Read More
  6. php 간단 심플한 달력만들기

    Date2023.01.12 Views241
    Read More
  7. PHP 가변변수 $$

    Date2019.02.19 Views1449
    Read More
  8. PHP ZIP 압축파일 만들기

    Date2023.01.12 Views251
    Read More
  9. PHP XML 문서파싱 (SAX 방식 , DOM 방식)

    Date2018.10.27 Views3585
    Read More
  10. php www 붙이기

    Date2023.01.12 Views234
    Read More
  11. PHP switch 문

    Date2015.04.14 Views20993
    Read More
  12. PHP str_replace php 문자열치환

    Date2023.01.12 Views197
    Read More
  13. PHP split()와 explode()의 차이점

    Date2018.10.27 Views3536
    Read More
  14. PHP SimpleHtmlDom Parser로 HTML 파싱하기

    Date2023.01.12 Views220
    Read More
  15. PHP Notice: Use of undefined constant ... assumed ... 오류

    Date2021.03.26 Views308
    Read More
  16. PHP Mcrypt 라이브러리를 활용한 암호화 시스템

    Date2016.12.22 Views19972
    Read More
  17. PHP http 를 https 로 전환(redirect), http->https

    Date2019.02.19 Views2183
    Read More
  18. PHP http -> https 로 전환

    Date2023.01.12 Views236
    Read More
  19. PHP EXCEL export시 시트 이름 지정하여 여러 시트에 데이터 쓰기

    Date2017.03.06 Views18266
    Read More
  20. PHP error 메시지 출력

    Date2015.04.14 Views20924
    Read More
Board Pagination Prev 1 ... 8 9 10 11 12 13 14 15 16 17 Next
/ 17

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved