-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support for entities in profile #97
base: development
Are you sure you want to change the base?
Conversation
As I didn't code the implementation of this in Turpial, I can't guarantee that the code works. |
This changes can't be applied because they break the get_entities() method use along the whole library. Please update this PR avoiding to touch get_entities method and I'll merge it |
Ok, so I need to create a method for entities from status and another one for entities from user profiles? |
Nop, you should use the same method for both. I see no need to modify it
|
Yes, I do. The structure of a tweet's entities is entities/urls[] or entities/user_mention[] https://dev.twitter.com/docs/entities#tweets when the structure of a user's entities is entities/url/urls[] or entities/description/urls[] https://dev.twitter.com/docs/entities#users. I can't use the current version of the get_entities() method to parse the user's entities. |
Yes, you can. Let me comment in the code |
@@ -461,6 +461,8 @@ def json_to_profile(self, response): | |||
profile.location = response['location'] | |||
profile.url = response['url'] | |||
profile.bio = response['description'] | |||
if 'url' in response['entities']: | |||
profile.entities = self.get_entities(response['entities']['url']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you just need to do:
profile.entities = self.get_entities(response)
I don't have time to work on this anymore (at least not before two months). You are welcome to take over this code. |
Roger that |
Add initial support for entities in profile, limited to the Web field at the moment. Needed to solve satanas/Turpial#270 and satanas/Turpial#249