tangled
alpha
login
or
join now
moth11.net
/
88x31
0
fork
atom
tiny 88x31 lexicon for atproto
0
fork
atom
overview
issues
pulls
pipelines
lol
moth11.net
1 month ago
5d3c0932
ef727c7e
+17
-18
2 changed files
expand all
collapse all
unified
split
handler
button.go
handler.go
-18
handler/button.go
···
2
2
3
3
import (
4
4
"encoding/json"
5
5
-
"github.com/bluesky-social/indigo/atproto/identity"
6
6
-
"github.com/bluesky-social/indigo/atproto/syntax"
7
5
"log"
8
6
"net/http"
9
7
"strconv"
···
60
58
61
59
func (h *Handler) getLikedButtons(w http.ResponseWriter, r *http.Request) {
62
60
did := r.URL.Query().Get("did")
63
63
-
handle := r.URL.Query().Get("handle")
64
64
-
65
65
-
if did == "" && handle != "" {
66
66
-
h, err := syntax.ParseHandle(handle)
67
67
-
if err == nil {
68
68
-
id, err := identity.DefaultDirectory().LookupHandle(r.Context(), h)
69
69
-
if err == nil {
70
70
-
did = id.DID.String()
71
71
-
log.Println(did)
72
72
-
} else {
73
73
-
log.Println(err.Error())
74
74
-
}
75
75
-
} else {
76
76
-
log.Println(err.Error())
77
77
-
}
78
78
-
}
79
61
80
62
limita := r.URL.Query().Get("limit")
81
63
limit, err := strconv.Atoi(limita)
+17
handler/handler.go
···
3
3
import (
4
4
"fmt"
5
5
"github.com/bluesky-social/indigo/atproto/auth/oauth"
6
6
+
"github.com/bluesky-social/indigo/atproto/identity"
7
7
+
"github.com/bluesky-social/indigo/atproto/syntax"
6
8
"github.com/gorilla/sessions"
7
9
"html/template"
8
10
"log"
···
261
263
func (h *Handler) getuserlikes(w http.ResponseWriter, r *http.Request) {
262
264
q := r.URL.Query()
263
265
did := q.Get("did")
266
266
+
handle := r.URL.Query().Get("handle")
267
267
+
if did == "" && handle != "" {
268
268
+
h, err := syntax.ParseHandle(handle)
269
269
+
if err == nil {
270
270
+
id, err := identity.DefaultDirectory().LookupHandle(r.Context(), h)
271
271
+
if err == nil {
272
272
+
did = id.DID.String()
273
273
+
log.Println(did)
274
274
+
} else {
275
275
+
log.Println(err.Error())
276
276
+
}
277
277
+
} else {
278
278
+
log.Println(err.Error())
279
279
+
}
280
280
+
}
264
281
bg := q.Get("bg")
265
282
if len(bg) == 6 {
266
283
bg = fmt.Sprintf("#%s", bg)