Skip to content

Commit 667324e

Browse files
committed
Update example
1 parent 4153452 commit 667324e

File tree

1 file changed

+8
-49
lines changed

1 file changed

+8
-49
lines changed

examples/search_and_post.ipynb

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,27 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": null,
66
"metadata": {},
7-
"outputs": [
8-
{
9-
"data": {
10-
"text/plain": [
11-
"<Response [200]>"
12-
]
13-
},
14-
"execution_count": 1,
15-
"metadata": {},
16-
"output_type": "execute_result"
17-
}
18-
],
7+
"outputs": [],
198
"source": [
209
"from plemmy import LemmyHttp\n",
2110
"\n",
2211
"# connect to server, log in\n",
23-
"srv = LemmyHttp(\"https://lemmy.blue\")\n",
12+
"srv = LemmyHttp(\"https://lemmy.world\")\n",
2413
"srv.login(\"<username_or_email>\", \"<password>\")"
2514
]
2615
},
2716
{
2817
"cell_type": "code",
29-
"execution_count": 2,
18+
"execution_count": null,
3019
"metadata": {},
31-
"outputs": [
32-
{
33-
"name": "stdout",
34-
"output_type": "stream",
35-
"text": [
36-
"Name: lemmyblue\n",
37-
"Actor ID: https://lemmy.blue/c/lemmyblue\n",
38-
"Num. ID: 2\n",
39-
"Moderators:\n",
40-
"lemmyblue lemmyblue 2\n"
41-
]
42-
}
43-
],
20+
"outputs": [],
4421
"source": [
4522
"from plemmy.responses import GetCommunityResponse\n",
4623
"\n",
4724
"# obtain community, parse JSON\n",
48-
"api_response = srv.get_community(name=\"lemmyblue\")\n",
25+
"api_response = srv.get_community(name=\"lemmy\")\n",
4926
"response = GetCommunityResponse(api_response)\n",
5027
"\n",
5128
"# access community information\n",
@@ -60,20 +37,9 @@
6037
},
6138
{
6239
"cell_type": "code",
63-
"execution_count": 3,
40+
"execution_count": null,
6441
"metadata": {},
65-
"outputs": [
66-
{
67-
"name": "stdout",
68-
"output_type": "stream",
69-
"text": [
70-
"Creator ID: 292833\n",
71-
"Community ID: 2\n",
72-
"Post title: Test post please ignore\n",
73-
"Post body: Body text\n"
74-
]
75-
}
76-
],
42+
"outputs": [],
7743
"source": [
7844
"from plemmy.responses import PostResponse\n",
7945
"\n",
@@ -88,13 +54,6 @@
8854
"print(f\"Post title: {post.name}\")\n",
8955
"print(f\"Post body: {post.body}\")"
9056
]
91-
},
92-
{
93-
"cell_type": "code",
94-
"execution_count": null,
95-
"metadata": {},
96-
"outputs": [],
97-
"source": []
9857
}
9958
],
10059
"metadata": {

0 commit comments

Comments
 (0)