Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix structure for UserObj.Entities #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hemildesai
Copy link

UserObj.entities has a different structure as defined at https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/user

Basically, it includes the common EntitiesObj for two different keys - url and description pertaining to the User's URL and User's Description.

@@ -42,22 +42,28 @@ func userFieldStringArray(arr []UserField) []string {
return strs
}

// User entities structure as defined at https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/user
type UserEntitiesObj struct {
URL *EntitiesObj `json:"url,omitempty"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not seeing in the URL entity where the annotations, hash tags, mentions, and cash tags are included.

you could have it like this

type UserURLEnttityObj struct {
    URLs        []EntityURLObj        `json:"urls"` 
}
type UserEntitiesObj struct {
    URL *UserURLEnttityObj   `json:"url"`
    Description *EntitiesObj    `json:"description"`
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants