Notices


Reply
Thread Tools
Posts: 3 | Thanked: 0 times | Joined on Jul 2011
#1
Hello,

I try to fetch some data via the version facebook API using python. However I just want to see the total number of followers my friends have . please give me sample code

[

Last edited by mikedemon; 2011-07-17 at 19:30.
 
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#2
The dict object that you posted has bad syntax ('count' value and 'icon' value). I adjusted it to

Code:
user = {u'count': '.diggstatic.com/user/6754998/r.png', u'gender': u'', u'diggs': 64104, u'comments': 226, u'followers': 3582, u'location': u'Lahore', u'following': 217, u'submissions': 441, u'icon': u'http://cdn1.diggstatic.com/user/6754998/p.png', u'timestamp': 1310895431, u'cursor': u'', u'version': u'2.0', u'authorized': '0', u'data': u'users', u'method': u'user.getInfo', u'user': None}
and was able to print a value by entering

Code:
print user['followers']
3582
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub
 

The Following User Says Thank You to marxian For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 17:49.