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
3
import (
4
"encoding/json"
5
-
"github.com/bluesky-social/indigo/atproto/identity"
6
-
"github.com/bluesky-social/indigo/atproto/syntax"
7
"log"
8
"net/http"
9
"strconv"
···
60
61
func (h *Handler) getLikedButtons(w http.ResponseWriter, r *http.Request) {
62
did := r.URL.Query().Get("did")
63
-
handle := r.URL.Query().Get("handle")
64
-
65
-
if did == "" && handle != "" {
66
-
h, err := syntax.ParseHandle(handle)
67
-
if err == nil {
68
-
id, err := identity.DefaultDirectory().LookupHandle(r.Context(), h)
69
-
if err == nil {
70
-
did = id.DID.String()
71
-
log.Println(did)
72
-
} else {
73
-
log.Println(err.Error())
74
-
}
75
-
} else {
76
-
log.Println(err.Error())
77
-
}
78
-
}
79
80
limita := r.URL.Query().Get("limit")
81
limit, err := strconv.Atoi(limita)
···
2
3
import (
4
"encoding/json"
0
0
5
"log"
6
"net/http"
7
"strconv"
···
58
59
func (h *Handler) getLikedButtons(w http.ResponseWriter, r *http.Request) {
60
did := r.URL.Query().Get("did")
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
61
62
limita := r.URL.Query().Get("limit")
63
limit, err := strconv.Atoi(limita)
+17
handler/handler.go
···
3
import (
4
"fmt"
5
"github.com/bluesky-social/indigo/atproto/auth/oauth"
0
0
6
"github.com/gorilla/sessions"
7
"html/template"
8
"log"
···
261
func (h *Handler) getuserlikes(w http.ResponseWriter, r *http.Request) {
262
q := r.URL.Query()
263
did := q.Get("did")
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
264
bg := q.Get("bg")
265
if len(bg) == 6 {
266
bg = fmt.Sprintf("#%s", bg)
···
3
import (
4
"fmt"
5
"github.com/bluesky-social/indigo/atproto/auth/oauth"
6
+
"github.com/bluesky-social/indigo/atproto/identity"
7
+
"github.com/bluesky-social/indigo/atproto/syntax"
8
"github.com/gorilla/sessions"
9
"html/template"
10
"log"
···
263
func (h *Handler) getuserlikes(w http.ResponseWriter, r *http.Request) {
264
q := r.URL.Query()
265
did := q.Get("did")
266
+
handle := r.URL.Query().Get("handle")
267
+
if did == "" && handle != "" {
268
+
h, err := syntax.ParseHandle(handle)
269
+
if err == nil {
270
+
id, err := identity.DefaultDirectory().LookupHandle(r.Context(), h)
271
+
if err == nil {
272
+
did = id.DID.String()
273
+
log.Println(did)
274
+
} else {
275
+
log.Println(err.Error())
276
+
}
277
+
} else {
278
+
log.Println(err.Error())
279
+
}
280
+
}
281
bg := q.Get("bg")
282
if len(bg) == 6 {
283
bg = fmt.Sprintf("#%s", bg)