def add_follow_user(user_id, user_link, user_name): """ Adds a given user to the list of users to follow. """ feed = u.get_user_feed('user/follows.xml') tree = feed.xpath('/channel/items') element = E.item( E.user_id(user_id), E.user_name(user_name), E.user_link(user_link) ) tree.append(element) u.write_user_feed(feed, 'user/follows.xml')
def add_blocked_user(user_id, user_link, user_name): """ Adds a given user to the block list. """ feed = u.get_user_feed('user/blocks.xml') tree = feed.xpath('/channel/items') element = E.item( E.user_id(user_id), E.user_name(user_name), E.user_link(user_link) ) tree.append(element) u.write_user_feed(feed, 'user/blocks.xml')