kopia lustrzana https://github.com/jcarbaugh/python-webfinger
add Activity Streams and OpenSocial
rodzic
f422e0af82
commit
04b2dba4a6
|
@ -2,9 +2,11 @@ from xrd import XRD
|
||||||
import urllib, urllib2
|
import urllib, urllib2
|
||||||
|
|
||||||
RELS = {
|
RELS = {
|
||||||
|
'activity_streams': 'http://activitystrea.ms/spec/1.0',
|
||||||
'avatar': 'http://webfinger.net/rel/avatar',
|
'avatar': 'http://webfinger.net/rel/avatar',
|
||||||
'hcard': 'http://microformats.org/profile/hcard',
|
'hcard': 'http://microformats.org/profile/hcard',
|
||||||
'open_id': 'http://specs.openid.net/auth/2.0/provider',
|
'open_id': 'http://specs.openid.net/auth/2.0/provider',
|
||||||
|
'opensocial': 'http://ns.opensocial.org/2008/opensocial/activitystreams',
|
||||||
'portable_contacts': 'http://portablecontacts.net/spec/1.0',
|
'portable_contacts': 'http://portablecontacts.net/spec/1.0',
|
||||||
'profile': 'http://webfinger.net/rel/profile-page',
|
'profile': 'http://webfinger.net/rel/profile-page',
|
||||||
'xfn': 'http://gmpg.org/xfn/11',
|
'xfn': 'http://gmpg.org/xfn/11',
|
||||||
|
@ -87,10 +89,13 @@ def finger(identifier, timeout=None):
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import sys
|
import sys
|
||||||
wf = finger(sys.argv[1])
|
wf = finger(sys.argv[1])
|
||||||
print "Avatar: ", wf.avatar
|
print "Activity Streams: ", wf.activity_streams
|
||||||
print "HCard: ", wf.hcard
|
print "Avatar: ", wf.avatar
|
||||||
print "OpenID: ", wf.open_id
|
print "HCard: ", wf.hcard
|
||||||
print "Profile:", wf.profile
|
print "OpenID: ", wf.open_id
|
||||||
print "XFN: ", wf.find_link('http://gmpg.org/xfn/11', attr='href')
|
print "Open Social: ", wf.opensocial
|
||||||
|
print "Profile: ", wf.profile
|
||||||
|
print "Portable Contacts: ", wf.portable_contacts
|
||||||
|
print "XFN: ", wf.find_link('http://gmpg.org/xfn/11', attr='href')
|
||||||
if wf.insecure:
|
if wf.insecure:
|
||||||
print "Warning: Data was retrieved over an insecure connection"
|
print "Warning: Data was retrieved over an insecure connection"
|
||||||
|
|
Ładowanie…
Reference in New Issue