UNPKG

978 BMarkdownView Raw
1
2# Reblog
3
4`Reblog` handler class.
5
6## API
7
8### Reblog(post-id, site-id, WPCOM);
9
10Create a new `Reblog` instance giving `post-id`, `site-id` and `WPCOM` instance.
11
12```js
13var reblog = Reblog('<post-id>', '<site-id>', WPCOM);
14```
15
16### Reblog#state([query], fn)
17
18`Reblog#mine` alias.
19
20### Reblog#mine([query], fn)
21
22Get your reblog status for the Post
23
24```js
25wpcom
26.site('blog.wordpress.com')
27.post(342)
28.reblog()
29.mine(function(err, data){
30 // reblog `data` object
31});
32```
33
34### Reblog#add(body, fn)
35
36Reblog the post
37
38```js
39var body = {
40 destination_site_id: 456,
41 note: 'Really nice a blog post !'
42};
43
44wpcom
45.site('blog.wordpress.com')
46.post(342)
47.reblog()
48.add(body, function(err, data){
49 // I've reblogged this 342 post
50});
51```
52
53### Reblog#to(destination_site_id, [note], fn)
54
55It's almost a `Reblog#mine` alias.
56
57```js
58wpcom
59.site('blog.wordpress.com')
60.post(342)
61.reblog()
62.to(456, 'Really nice a blog post !', function(err, data){
63 // I've reblogged this 342 post
64});
65```