質問編集履歴
2
情報の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -19,6 +19,16 @@
|
|
19
19
|
|
20
20
|
|
21
21
|
```python
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
from wordpress_xmlrpc import Client, WordPressPost
|
26
|
+
|
27
|
+
from wordpress_xmlrpc.methods.posts import GetPosts, NewPost
|
28
|
+
|
29
|
+
from wordpress_xmlrpc.methods.users import GetUserInfo
|
30
|
+
|
31
|
+
|
22
32
|
|
23
33
|
wp = Client('サイトURLxxx', 'ユーザーIDxxx', 'パスxxx')
|
24
34
|
|
1
情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -15,3 +15,43 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
なにかアイデアをお持ちの方、教えていただけると幸いです。
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
```python
|
22
|
+
|
23
|
+
wp = Client('サイトURLxxx', 'ユーザーIDxxx', 'パスxxx')
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
post = WordPressPost()
|
30
|
+
|
31
|
+
ws = wb.Worksheets("Sheet1")
|
32
|
+
|
33
|
+
# 記事タイトル
|
34
|
+
|
35
|
+
post.title = ws.Range("B2").value
|
36
|
+
|
37
|
+
# 記事内容
|
38
|
+
|
39
|
+
post.content = ws.Range("a1").value
|
40
|
+
|
41
|
+
post.terms_names = {'category': ["有料時系列過去データ一覧"]}
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
# いきなり公開する設定。'draft'で下書き公開
|
46
|
+
|
47
|
+
post.post_status = 'publish'
|
48
|
+
|
49
|
+
wp.call(NewPost(post))
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
wb.Save()
|
54
|
+
|
55
|
+
wb.Close()
|
56
|
+
|
57
|
+
```
|