python-friendica/test_poco.py

26 wiersze
686 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
small script to test the POCO functionality of the friendica module
"""
import friendica
# for testing we use the POCO information of the Support forum
poco = friendica.poco (server = 'helpers.pyxis.uberspace.de', user = 'helpers',
proxy='localhost:8118')
# spit out the raw POCO information
poco.getPoco()
if poco.raw:
print('Total contacts: %d' % poco.totalResults)
print('Contact Data for contact [ 1 ]')
contact = poco.getContact(1)
print (contact)
print('\nListing all contacts')
for i in poco.contacts:
print(i['preferredUsername'])
else:
print('could not get POCO information')