https://docs.bsky.app/docs/api/app-bsky-feed-get-actor-likes Bluesky for SOME REASON limits viewing the likes to your own user. WHy? What is the point of having an "actor" field if you can only use 1 actor?"ADD THIS TO LOOKUP TABLE" I'm still gonna implement it, we can hope it will be expanded in th
(pds string, token string, context string, actor string, limit int)
| 1492 | // What is the point of having an "actor" field if you can only use 1 actor?"ADD THIS TO LOOKUP TABLE" |
| 1493 | // I'm still gonna implement it, we can hope it will be expanded in the future. |
| 1494 | func GetActorLikes(pds string, token string, context string, actor string, limit int) (*Timeline, error) { |
| 1495 | url := fmt.Sprintf(pds+"/xrpc/app.bsky.feed.getActorLikes?limit=%d&actor=%s", limit, actor) |
| 1496 | if context != "" { |
| 1497 | url = fmt.Sprintf(pds+"/xrpc/app.bsky.feed.getActorLikes?limit=%d&actor=%s&cursor=%s", limit, actor, context) |
| 1498 | } |
| 1499 | |
| 1500 | resp, err := SendRequest(&token, http.MethodGet, url, nil) |
| 1501 | if err != nil { |
| 1502 | return nil, err |
| 1503 | } |
| 1504 | defer resp.Body.Close() |
| 1505 | |
| 1506 | // // Print the response body |
| 1507 | // bodyBytes, _ := io.ReadAll(resp.Body) |
| 1508 | // bodyString := string(bodyBytes) |
| 1509 | // fmt.Println("Response Body:", bodyString) |
| 1510 | |
| 1511 | if resp.StatusCode != http.StatusOK { |
| 1512 | bodyBytes, _ := io.ReadAll(resp.Body) |
| 1513 | bodyString := string(bodyBytes) |
| 1514 | fmt.Println("Response Status:", resp.StatusCode) |
| 1515 | fmt.Println("Response Body:", bodyString) |
| 1516 | return nil, errors.New(bodyString) // return response |
| 1517 | } |
| 1518 | |
| 1519 | likes := Timeline{} |
| 1520 | if err := json.NewDecoder(resp.Body).Decode(&likes); err != nil { |
| 1521 | return nil, err |
| 1522 | } |
| 1523 | |
| 1524 | return &likes, nil |
| 1525 | } |
| 1526 | |
| 1527 | func GetRetweetAuthors(pds string, token string, uri string, limit int) (*RepostedBy, error) { |
| 1528 | url := fmt.Sprintf(pds+"/xrpc/app.bsky.feed.getRepostedBy?limit=%d&uri=%s", limit, uri) |
nothing calls this directly
no test coverage detected