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

Support for entities in profile #97

Open
wants to merge 5 commits into
base: development
Choose a base branch
from

Conversation

Bouska
Copy link
Contributor

@Bouska Bouska commented Feb 3, 2014

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

@Bouska
Copy link
Contributor Author

Bouska commented Feb 4, 2014

As I didn't code the implementation of this in Turpial, I can't guarantee that the code works.

@satanas
Copy link
Owner

satanas commented Mar 14, 2014

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

@Bouska
Copy link
Contributor Author

Bouska commented Mar 16, 2014

Ok, so I need to create a method for entities from status and another one for entities from user profiles?

@satanas
Copy link
Owner

satanas commented Mar 16, 2014

Nop, you should use the same method for both. I see no need to modify it
On Mar 16, 2014 6:25 PM, "Pablo Martin-Gomez" [email protected]
wrote:

Ok, so I need to create a method for entities from status and another one
for entities from user profiles?

Reply to this email directly or view it on GitHubhttps://github.com//pull/97#issuecomment-37771538
.

@Bouska
Copy link
Contributor Author

Bouska commented Mar 16, 2014

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.

@satanas
Copy link
Owner

satanas commented Mar 17, 2014

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'])
Copy link
Owner

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)

@Bouska
Copy link
Contributor Author

Bouska commented May 3, 2014

I don't have time to work on this anymore (at least not before two months). You are welcome to take over this code.

@satanas
Copy link
Owner

satanas commented May 3, 2014

Roger that

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