'hide' functionality.

Asked by Piotr Byzia on 2009-04-11

I guess that this is the official FF API constrain and that's why you don't provide a 'hide' functionality?
Also, PyAPI (and FF API) takes into account hidden elements, so that in entries from, say, Home Feed there are no items that were hidden using web interface -- is that right?

Question information

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

Hi Piotr,

I just added hide/unhide functionality to the library in r107 of the trunk. You'll find them as FriendFeedAPI.hide_entry() and .unhide_entry().

All entries are returned from feeds regardless of whether or not they are hidden. To determine if an entry is hidden, you can check its .hidden attribute. For example, let's say I would like to retrieve all hidden entries in my user feed:

>>> import friendfeed
>>> session = friendfeed.FriendFeedAPI('gotgenes', remotekey)
>>> entries = session.fetch_home_feed(num=5)
>>> session.hide_entry(entries[2])
True
>>> session.hide_entry(entries[4])
True
>>> entries = session.fetch_home_feed(num=10)
>>> hidden_entries = [entry for entry in entries if entry.hidden]
>>> hidden_entries
[<Entry {'hidden': True,
 'id': u'710881f8-36f1-9d1c-87a8-916a4c0a432c',
 'likes': [],
 'title': u'@docwalker So you just preferred the form...',
 'updated': datetime.datetime(2009, 4, 11, 19, 27, 59),
 'user': <User mkixi>}>, <Entry {'hidden': True,
 'id': u'f8af2f0e-2544-4fee-b362-5055afe6fb73',
 'likes': [],
 'title': u"Effects of Earthquake on Sun Microsystems'...",
 'updated': datetime.datetime(2009, 4, 11, 19, 39, 47),
 'user': <User imabonehead>}>]
>>>

Piotr Byzia (piotr-byzia) said : #2

Thanks Chris Lasher, that solved my question.