@@ -12,18 +12,23 @@ import (
1212)
1313
1414type RelatedResultsQuery struct {
15- Annotations interface {} `json:"annotations"` // TODO
16- ResultType string `json:"resultType"`
17- Score float64 `json:"score"`
18- GroupName string `json:"groupName"`
19- Results []Results `json:"results"`
15+ Annotations [] Annotations `json:"annotations"` // TODO
16+ ResultType string `json:"resultType"`
17+ Score float64 `json:"score"`
18+ GroupName string `json:"groupName"`
19+ Results []Results `json:"results"`
2020}
2121
2222type Results struct {
23- Kind string `json:"kind"`
24- Score float64 `json:"score"`
25- Annotations interface {} `json:"annotations"` // TODO
26- Value Tweet `json:"results"`
23+ Kind string `json:"kind"`
24+ Score float64 `json:"score"`
25+ Annotations []Annotations `json:"annotations"` // TODO
26+ Value Tweet `json:"value"`
27+ }
28+
29+ // TODO: Figure out what this is for, and how to use this
30+ type Annotations struct {
31+ ConversationRole string `json:"ConversationRole"`
2732}
2833
2934type Retweet struct {
@@ -277,10 +282,9 @@ func TwitterMsgIdToBluesky(id *big.Int) (*string, *time.Time, *string, error) {
277282 if err != nil {
278283 return nil , nil , nil , err
279284 }
280- } else {
285+ } else if len ( parts ) == 2 {
281286 // Any other type of tweet
282287 uri = parts [0 ]
283- fmt .Println (encodedId )
284288 timestamp , err = time .Parse ("20060102T15:04:05Z" , strings .ToUpper (parts [1 ]))
285289 if err != nil {
286290 return nil , nil , nil , err
@@ -291,6 +295,8 @@ func TwitterMsgIdToBluesky(id *big.Int) (*string, *time.Time, *string, error) {
291295 // return nil, nil, nil, errors.New("invalid URI format")
292296 // }
293297 // timestamp, err = DecodeTID(uriparts[4])
298+ } else {
299+ return nil , nil , nil , errors .New ("invalid ID format" )
294300 }
295301 return & uri , & timestamp , & retweetUserId , nil
296302}
0 commit comments