@@ -354,6 +354,91 @@ type FacetParsing struct {
354354 Item string
355355}
356356
357+ type Discovery struct {
358+ Statuses []Tweet `json:"statuses" xml:"statuses"`
359+ Stories []Story `json:"stories" xml:"stories"`
360+ RelatedQueries []RelatedQuery `json:"related_queries" xml:"related_queries"`
361+ SpellingCorrections []SpellingCorrection `json:"spelling_corrections" xml:"spelling_corrections"`
362+ }
363+
364+ type Story struct {
365+ Type string `json:"type" xml:"type"` // news or topic
366+ Score float32 `json:"score" xml:"score"`
367+ Data StoryData `json:"data" xml:"data"`
368+ SocialProof SocialProof `json:"social_proof" xml:"social_proof"`
369+ }
370+
371+ type StoryData struct {
372+ Title string `json:"title" xml:"title"`
373+ Articles []NewsArticle `json:"articles" xml:"articles"`
374+ }
375+
376+ // cringe that i need these multiple
377+
378+ type StoryURL struct {
379+ DisplayURL string `json:"display_url" xml:"display_url"`
380+ ExpandedURL string `json:"expanded_url" xml:"expanded_url"`
381+ }
382+
383+ type StoryMediaInfo struct {
384+ MediaURL string `json:"media_url" xml:"media_url"`
385+ Type string `json:"type" xml:"type"`
386+ Width int `json:"width" xml:"width"`
387+ Height int `json:"height" xml:"height"`
388+ VideoInfo * StoryVideoInfo `json:"video_info,omitempty" xml:"video_info,omitempty"`
389+ }
390+
391+ // speculating, is this for proper video support?
392+ type StoryVideoInfo struct {
393+ Variants []StoryVideoVariant `json:"variants" xml:"variants"`
394+ }
395+
396+ type StoryVideoVariant struct {
397+ URL string `json:"url" xml:"url"`
398+ ContentType string `json:"content_type" xml:"content_type"`
399+ }
400+
401+ type NewsArticle struct {
402+ Title string `json:"title" xml:"title"`
403+ Url StoryURL `json:"url" xml:"url"`
404+ Description string `json:"description" xml:"description"`
405+ TweetCount int `json:"tweet_count" xml:"tweet_count"`
406+ Attribution string `json:"attribution" xml:"attribution"`
407+ Score float32 `json:"score" xml:"score"`
408+ Query string `json:"query" xml:"query"`
409+ Name string `json:"name" xml:"name"` // no clue what the difference is between name and title. i guess the article's author
410+ Media []StoryMediaInfo `json:"media" xml:"media"`
411+ }
412+
413+ type SocialProof struct {
414+ Type string `json:"social_proof_type" xml:"social_proof_type"` // social or query
415+ ReferencedBy SocialProofedReferencedBy `json:"referenced_by" xml:"referenced_by"`
416+ }
417+
418+ type SocialProofedReferencedBy struct {
419+ Statuses []Tweet `json:"statuses" xml:"statuses"`
420+ GlobalCount int `json:"global_count" xml:"global_count"`
421+ }
422+
423+ type RelatedQuery struct {
424+ Query string `json:"query" xml:"query"`
425+ }
426+ type QueryWithIndices struct {
427+ Query string `json:"query" xml:"query"`
428+ Indices []int `json:"indices" xml:"-"`
429+ Start int `json:"-" xml:"start,attr"`
430+ End int `json:"-" xml:"end,attr"`
431+ }
432+
433+ //arrays upon arrays
434+
435+ type SpellingCorrection struct {
436+ Results []SpellingCorrectionResults `json:"results" xml:"results"`
437+ }
438+
439+ type SpellingCorrectionResults struct {
440+ Value QueryWithIndices `json:"value" xml:"value"`
441+
357442type AuthToken struct {
358443 * jwt.RegisteredClaims
359444 Version int `json:"version"` // Version of the token
0 commit comments