|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": 1, |
| 5 | + "execution_count": null, |
6 | 6 | "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": [], |
19 | 8 | "source": [ |
20 | 9 | "from plemmy import LemmyHttp\n", |
21 | 10 | "\n", |
22 | 11 | "# connect to server, log in\n", |
23 | | - "srv = LemmyHttp(\"https://lemmy.blue\")\n", |
| 12 | + "srv = LemmyHttp(\"https://lemmy.world\")\n", |
24 | 13 | "srv.login(\"<username_or_email>\", \"<password>\")" |
25 | 14 | ] |
26 | 15 | }, |
27 | 16 | { |
28 | 17 | "cell_type": "code", |
29 | | - "execution_count": 2, |
| 18 | + "execution_count": null, |
30 | 19 | "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": [], |
44 | 21 | "source": [ |
45 | 22 | "from plemmy.responses import GetCommunityResponse\n", |
46 | 23 | "\n", |
47 | 24 | "# obtain community, parse JSON\n", |
48 | | - "api_response = srv.get_community(name=\"lemmyblue\")\n", |
| 25 | + "api_response = srv.get_community(name=\"lemmy\")\n", |
49 | 26 | "response = GetCommunityResponse(api_response)\n", |
50 | 27 | "\n", |
51 | 28 | "# access community information\n", |
|
60 | 37 | }, |
61 | 38 | { |
62 | 39 | "cell_type": "code", |
63 | | - "execution_count": 3, |
| 40 | + "execution_count": null, |
64 | 41 | "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": [], |
77 | 43 | "source": [ |
78 | 44 | "from plemmy.responses import PostResponse\n", |
79 | 45 | "\n", |
|
88 | 54 | "print(f\"Post title: {post.name}\")\n", |
89 | 55 | "print(f\"Post body: {post.body}\")" |
90 | 56 | ] |
91 | | - }, |
92 | | - { |
93 | | - "cell_type": "code", |
94 | | - "execution_count": null, |
95 | | - "metadata": {}, |
96 | | - "outputs": [], |
97 | | - "source": [] |
98 | 57 | } |
99 | 58 | ], |
100 | 59 | "metadata": { |
|
0 commit comments