Commit | Line | Data |
---|---|---|
d6e4e60d AS |
1 | Jan Pona Mute |
2 | ============= | |
3 | ||
4 | The name is Toki Pona and means "many friends". | |
5 | ||
6 | This is a very simple command line client for Diaspora that helps me | |
7 | deal with my specific use-cases: | |
8 | ||
9 | - I want to check Diaspora for new comment on my threads | |
10 | - I want to leave new comments on my threads | |
11 | - I want to delete comments I left by mistake | |
12 | ||
13 | It's *very* limited but it's helping me get started using the | |
1a00f4c0 | 14 | [diaspy](https://github.com/marekjm/diaspy) Python library. |
bfc18b3e | 15 | |
56a22d5e AS |
16 | <!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --> |
17 | **Table of Contents** | |
18 | ||
19 | - [Installation](#installation) | |
20 | - [Quickstart](#quickstart) | |
21 | - [Next Step](#next-step) | |
22 | - [Notes](#notes) | |
23 | - [Reference](#reference) | |
24 | ||
25 | <!-- markdown-toc end --> | |
26 | ||
bfc18b3e AS |
27 | Installation |
28 | ------------ | |
29 | ||
1a00f4c0 | 30 | We need the [diaspy](https://github.com/marekjm/diaspy) library. |
bfc18b3e | 31 | |
a5282113 | 32 | ```text |
b8a9d951 AS |
33 | $ git clone https://github.com/marekjm/diaspy.git |
34 | $ cd diaspy | |
35 | $ pip3 install . | |
bfc18b3e AS |
36 | ``` |
37 | ||
1a00f4c0 AS |
38 | This gives me version 0.6.0. When I use `pip3 install diaspy` I get |
39 | version 0.3.0 and that doesn't work. 🤷 | |
b8a9d951 | 40 | |
bfc18b3e | 41 | Quickstart |
56a22d5e | 42 | ---------- |
bfc18b3e | 43 | |
a5282113 | 44 | ```text |
bfc18b3e AS |
45 | $ python3 jan-pona-mute.py |
46 | Welcome to Diaspora! Use the intro command for a quick introduction. | |
47 | Pager set: /usr/bin/fold | |
48 | > account kensanata@pluspora.com | |
49 | Username and pod set: kensanata@pluspora.com | |
50 | > password *secret* | |
51 | Password set | |
52 | > login | |
1860d749 AS |
53 | Setting up a connection... |
54 | Logging in... | |
e1a5ba15 | 55 | > notifications |
bfc18b3e AS |
56 | 1. 2019-08-13T19:40:17.000Z Joe Doe has liked your post I've started writing... |
57 | 2. 2019-08-13T17:59:23.000Z Joe Doe commented on your post Please help me wi... | |
58 | 3. 2019-08-13T17:03:45.000Z Jane Doe has liked your post I've started writin... | |
59 | 4. 2019-08-13T15:02:50.000Z June Doe commented on your post I don't like Mon... | |
60 | 5. 2019-08-13T14:48:51.000Z John Doe liked your post Monday again! What am I... | |
61 | Enter a number to select the notification. | |
62 | > 1 | |
63 | 2019-08-13T19:40:17.000Z Joe Doe has liked your post I've started writing... | |
64 | Loading... | |
65 | ||
66 | I've started writing a Diaspora client for the command line. It's called Jan Pona | |
67 | Mute which means as much as "many friends" in English. It's written in Python and | |
68 | doesn't do much. | |
69 | > comments | |
70 | There are no comments on the selected post. | |
71 | > comment This is me leaving a comment. | |
72 | Comment posted | |
73 | > comments | |
74 | ||
75 | 1. 2019-08-13T20:04:35.000Z Alex Schroeder | |
76 | ||
77 | Alex Schroeder (e3bd7110b2ee013620f200505608f9fe): This is me leaving a comment. | |
78 | > quit | |
79 | Be safe! | |
80 | ``` | |
81 | ||
82 | Next Step | |
83 | --------- | |
84 | ||
85 | Use the `save` command to save the login information (including the | |
86 | password!) to an init file. | |
87 | ||
88 | The init files searched are: | |
89 | ||
90 | 1. `~/.config/jan-pona-mute/login` | |
281401ba | 91 | 2. `~/.jan-pona-mute.d/login` |
bfc18b3e AS |
92 | 3. `~/.jan-pona-mute` |
93 | ||
94 | If one of them exists while starting up, that's the file that gets | |
95 | written. If none exists, the first one is going to be created by the | |
96 | `save` command. | |
97 | ||
98 | Any further commands you put into the file are simple executed as if | |
e1a5ba15 AS |
99 | you were to type them every time you start the program. A simple |
100 | change would be to add `notifications` as a command to the end of the | |
101 | file. | |
bfc18b3e | 102 | |
8aac6bbd AS |
103 | Notes |
104 | ----- | |
105 | ||
106 | One thing I care about is editing comments with my favourite editor | |
1f585158 AS |
107 | and previewing them. This works really well if you have |
108 | [mdcat](https://github.com/lunaryorn/mdcat) as it renders Markdown. | |
109 | Here's the workflow: | |
8aac6bbd AS |
110 | |
111 | 1. check notifications | |
112 | 2. pick a post | |
113 | 3. show latest comments | |
114 | 4. compose a note | |
115 | 5. preview note | |
116 | 6. leave a comment with that note | |
117 | ||
118 | This is what it looks like, assuming your editor is `ed`: | |
119 | ||
a5282113 | 120 | ```text |
8aac6bbd AS |
121 | > notifications |
122 | ... | |
123 | > 1 | |
124 | ... | |
125 | > comments | |
126 | ... | |
127 | > note nice | |
128 | /home/alex/.config/jan-pona-mute/notes/nice: No such file or directory | |
129 | a | |
130 | OK, I like this. Thanks! | |
131 | . | |
132 | w | |
133 | 25 | |
134 | q | |
135 | 1. nice | |
136 | Use 'edit' to create a note. | |
137 | > preview 1 | |
138 | OK, I like this. Thanks! | |
139 | > comment 1 | |
140 | ``` | |
141 | ||
bfc18b3e AS |
142 | Reference |
143 | --------- | |
144 | ||
145 | So much is still in flux. Please use the `help` command to learn more. | |
1f585158 AS |
146 | |
147 | * use **intro** if you want to skip reading the rest of this list 😅 | |
148 | ||
149 | * use **account**, **password**, and **login** to login into your | |
150 | account; use **save** to store these three commands in your init | |
151 | file | |
152 | ||
153 | * use **shortcuts** to show the current shortcuts; use **shortcut** to | |
154 | define a new shortcut; these are good commands to add to your init | |
155 | file (the **save** command won't do this for you) | |
156 | ||
157 | * use **notifications** to see the latest notifications, use | |
158 | **notifications reload** to update the list; this is also a good | |
159 | command to add to your init file | |
160 | ||
161 | * use **home** to see your home stream, use **home reload** to update | |
162 | the list; use **home all** to see the full list; use **home 3** to | |
163 | see the last 3 items | |
164 | ||
165 | * use **show** and a number to show the post a notification is | |
166 | referring to, or to choose a post from your home stream; this is | |
167 | what then allows you to use **comments** to show the comments to | |
168 | that post; use **comments 3** to see the last 3 items | |
169 | ||
170 | * use **comment** to post a comment, use **post** to write a new post; | |
171 | if you use a number instead of a writing a text, the number refers | |
172 | to a note (see below) | |
173 | ||
174 | * use **undo** to delete a comment or post after writing it; use | |
175 | **delete comment** or **delete post** to delete them at a later date | |
176 | ||
177 | * use **edit** and a filename to write a note; use **notes** to list | |
178 | your notes; use **preview** to show a note; use **delete note** to | |
179 | delete a note | |
180 | ||
181 | * use **editor** to set your favourite editor (or set the EDITOR | |
182 | environment variable); use **pager** to set your favourite page (or | |
183 | set the PAGER environment variable); consider installing | |
184 | [mdcat](https://github.com/lunaryorn/mdcat) and using it as your pager | |
185 | ||
186 | * use **info** to review your settings | |
187 | ||
188 | * use **quit** to end the program |