You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I used the example from README, but it doesn't work at all. Can you give me some advices? My code is as follows:
import fbchat
client = fbchat.Client("MY_ID", "MY_PASSWORD")
friends = client.getUsers("Ning") # I tried a friend's name
friend = friends[0]
After executing the code, it shows the following error messages:
friends = client.getUsers('Ning')
File "build/bdist.linux-x86_64/egg/fbchat/client.py", line 189, in getUsers
File "build/bdist.linux-x86_64/egg/fbchat/utils.py", line 18, in get_json
File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting ',' delimiter: line 1 column 63 (char 62)
Thanks!
The text was updated successfully, but these errors were encountered:
hman190
changed the title
client.getUsers('"FRIEND'S NAME"') doesn't work
client.getUsers("FRIEND'S NAME") doesn't work
Apr 2, 2016
Download the repo on your computer, then edit utils.py file. Try to change get_json(text) function from this: return json.loads(re.sub(r"for.*(.*;.*;.*).*;", '', text.encode('utf-8').decode("unicode-escape"), 1)) to this: return json.loads(re.sub(r"^[^{]*", '', text, 1)). Save the file and install fbchat again via setup.py from the folder you've downloaded.
Hi,
I used the example from README, but it doesn't work at all. Can you give me some advices? My code is as follows:
After executing the code, it shows the following error messages:
Thanks!
The text was updated successfully, but these errors were encountered: