lastlegion / python-twitter

Automatically exported from code.google.com/p/python-twitter
Apache License 2.0
0 stars 0 forks source link

[patch] User object should have 'verified' property #137

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

api = twitter.Api(username=username, password=password)
user = api.GetUser('username')
if user.verified:
  do_something()

What is the expected output? What do you see instead?

The User object should have the 'verified' property defined in the Twitter API.

Instead, python throws an error, because the property is not present.

What version of the product are you using? On what operating system?

0.6-devel (latest HEAD) on fedora 12 (i686 and x86_64)

Please provide any additional information below.

A patch that implements this property is attached.

Original issue reported on code.google.com by jpwi...@gmail.com on 21 Apr 2010 at 2:27

Attachments:

GoogleCodeExporter commented 9 years ago
I had trouble using the file attached to achieve this functionality. I 
implemented the 
property myself and have attached a patch to twitter.py

Original comment by ghi...@gmail.com on 29 May 2010 at 9:56

Attachments:

GoogleCodeExporter commented 9 years ago
ghills - the patch I submitted is against the dev branch, not the master 
branch.  I
assumed when I wrote the patch that the dev branch was the correct place for new
development (as per the instructions at 
http://code.google.com/p/python-twitter/);
so, I'm not sure which of our patches is more relevant.

Original comment by jpwi...@gmail.com on 2 Jun 2010 at 5:15

GoogleCodeExporter commented 9 years ago
Oh I see, my mistake. I completely missed that.

Original comment by ghi...@gmail.com on 3 Jun 2010 at 6:57

GoogleCodeExporter commented 9 years ago
:)

Once this OAuth switch happens I think we will need to revisit both branches 
and make the switch to push the 
dev branch to trunk.

Which means I will be hand-porting a bit of code, but that's not a big issue 
for me.

Original comment by bear42 on 3 Jun 2010 at 7:23

GoogleCodeExporter commented 9 years ago
Has there been any progress on adding this simple piece of information?

Original comment by dpao...@gmail.com on 26 Jun 2010 at 7:12

GoogleCodeExporter commented 9 years ago
dpaola - If you are using the main branch, the patch in comment 1 will do the 
trick.  If you're on the dev branch, the patch in the original post will do it.

In either event, you can apply the patch with something like:

cd /path/to/python-twitter-hg/
patch -p1 < /path/to/python-twitter-verified-user.patch

Then the usual 'python setup.py install' (or however you prefer to install) 
will put those changes into your installed copy.  This process should serve 
until the patch(es) are committed into the repo.

If you're on a non-*nix OS, I'm sure there's some way to apply a patch as well.

Original comment by jpwi...@gmail.com on 28 Jun 2010 at 11:26

GoogleCodeExporter commented 9 years ago
I have applied the above patch. Iam using the following code
api = twitter.Api()
user = api.GetUser('username')
print user.verified

but It always returns False. Please write an example usage as well.

thanks

Original comment by ashwinmo...@gmail.com on 6 Jul 2010 at 11:37

GoogleCodeExporter commented 9 years ago
I can't speak for ghills' patch, but with my patch (the one on the dev branch) 
you can simply do:

print user.verified

as you suggest.  I can confirm that verified users have verified = True and 
that non-verified users have verified = False with my patch.

Original comment by jpwi...@gmail.com on 6 Jul 2010 at 3:16

GoogleCodeExporter commented 9 years ago
committed changeset 230:023e6dfe5f52

Original comment by bear42 on 16 Apr 2011 at 10:35