forked from mattn/webapi-vim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetaWeblog.vim
More file actions
46 lines (35 loc) · 1.66 KB
/
metaWeblog.vim
File metadata and controls
46 lines (35 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
" metaweblog
" Last Change: 2010-09-10
" Maintainer: Yasuhiro Matsumoto <[email protected]>
" License: This file is placed in the public domain.
" Reference:
" http://tools.ietf.org/rfc/rfc3529.txt
let s:save_cpo = &cpo
set cpo&vim
let s:template = {"uri" : ""}
function! s:template.newPost(blogid, username, password, content, publish) dict abort
return webapi#xmlrpc#call(self.uri, 'metaWeblog.newPost', [a:blogid, a:username, a:password, a:content, a:publish])
endfunction
function! s:template.editPost(postid, username, password, content, publish) dict abort
return webapi#xmlrpc#call(self.uri, 'metaWeblog.editPost', [a:postid, a:username, a:password, a:content, a:publish])
endfunction
function! s:template.getPost(postid, username, password) dict abort
return webapi#xmlrpc#call(self.uri, 'metaWeblog.getPost', [a:postid, a:username, a:password])
endfunction
function! s:template.getRecentPosts(blogid, username, password, numberOfPosts) dict abort
return webapi#xmlrpc#call(self.uri, 'metaWeblog.getRecentPosts', [a:blogid, a:username, a:password, a:numberOfPosts])
endfunction
function! s:template.deletePost(appkey, postid, username, password, ...) dict abort
return webapi#xmlrpc#call(self.uri, 'blogger.deletePost', [a:apikey, a:postid, a:username, a:password])
endfunction
function! s:template.newMediaObject(blogid, username, password, file) dict abort
return webapi#xmlrpc#call(self.uri, 'metaWeblog.newMediaObject', [a:blogid, a:username, a:password, a:file])
endfunction
function! webapi#metaWeblog#proxy(uri) abort
let ctx = deepcopy(s:template)
let ctx.uri = a:uri
return ctx
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
" vim:set et: