tangled
alpha
login
or
join now
moth11.net
/
88x31
0
fork
atom
tiny 88x31 lexicon for atproto
0
fork
atom
overview
issues
pulls
pipelines
add limit and doc
moth11.net
1 month ago
0fba1579
49c02ec5
+18
-1
1 changed file
expand all
collapse all
unified
split
handler
handler.go
+18
-1
handler/handler.go
···
189
189
"https://88x31.store/embed/liked-by?handle=moth11.net",
190
190
},
191
191
{
192
192
+
"limit=",
193
193
+
"integer as string",
194
194
+
"min=1, max=100, fetches up to limit liked buttons reverse chronologically",
195
195
+
"https://88x31.store/embed/liked-by?did=did:plc:25z6ogppprfvijcnqo2fsfce&limit=2",
196
196
+
},
197
197
+
{
192
198
"attribute=",
193
199
"non-empty string",
194
200
"any non-empty string for attribute will add a line at the bottom of the generated html linking to 88x31.store. no worries if you prefer the plain look!",
···
214
220
did = id.DID.String()
215
221
}
216
222
}
223
223
+
}
224
224
+
limit := q.Get("limit")
225
225
+
lint, err := strconv.Atoi(limit)
226
226
+
if err != nil {
227
227
+
lint = 50
228
228
+
}
229
229
+
if lint < 1 {
230
230
+
lint = 1
231
231
+
}
232
232
+
if lint > 100 {
233
233
+
lint = 100
217
234
}
218
235
cursor := q.Get("cursor")
219
236
var crsr *string
···
261
278
default:
262
279
imageRendering = "pixelated"
263
280
}
264
264
-
btns, ncrsr, err := h.db.GetUserLikes(did, 50, crsr, r.Context())
281
281
+
btns, ncrsr, err := h.db.GetUserLikes(did, lint, crsr, r.Context())
265
282
if err != nil {
266
283
log.Println(err)
267
284
http.Error(w, "error", http.StatusInternalServerError)