Can Not Search

Asked by Fictoris on 2009-09-15

I can not use the search functionality of friendfeed with this API. I am calling with this:

entries = session.search('Cameron Battagler')

and getting this error:

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    entries = session.search('Cameron Battagler')
  File "C:\Python26\lib\site-packages\friendfeed.py", line 2775, in search
    num
  File "C:\Python26\lib\site-packages\friendfeed.py", line 2660, in search_iter
    response = self._fetch('/feed/search', url_args=url_args)
  File "C:\Python26\lib\site-packages\friendfeed.py", line 1345, in _fetch
    response = parse_json(data)
  File "C:\Python26\lib\site-packages\friendfeed.py", line 48, in <lambda>
    parse_json = lambda s: json.loads(s.decode('utf-8'))
  File "C:\Python26\lib\json\__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "C:\Python26\lib\json\decoder.py", line 319, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python26\lib\json\decoder.py", line 338, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Any theory as to what may be happening?

Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
FriendFeed PyAPI Edit question
Assignee:
No assignee Edit question
Solved by:
Chris Lasher
Solved:
2009-09-15
Last query:
2009-09-15
Last reply:
2009-09-15
Best Chris Lasher (chris.lasher) said : #1

No theory needed, just square braces. :-) Try:

entries = session.search(['Cameron', 'Battagler'])

The terms argument to FriendFeedAPI.search() should be a list or an iterable, as stated in the docstring for the search() method.

Thanks Chris Lasher, that solved my question.

Chris Lasher (chris.lasher) said : #3

No problem. Post more questions as you have them.

Will do...Can you tell I haven't used Python in a while?...