Sicco van Sas

My comments on the Anymeta API session

Open your Mac terminal

Install the anymeta python API
sysop$ sudo easy_install AnymetaAPI

Create a registry link to mediamatic.net
sysop$ any-registry add mymediamatic http://www.mediamatic.net/

List the current links
sysop$ any-registry list

Open the anymeta python API, all calls beyond this point are thus in python.
sysop$ any-registry cli mymediamatic

Retrieve my own user info
>>> self = api.anymeta.user.info()

Import a special print function
>>> from pprint import pprint

Print my self data
>>> pprint(self)

Retrieve information corresponding to a RFID tag (this is Arjen’s RFID)
>>> result = api.identity.identify(type='rfid', raw='urn:rfid:FE7F5F5C')
>>> pprint(result)

Retrieve the resource ID corresponding to the RFID tag
>>> arjan_id = api.identity.identify(type='rfid', raw='urn:rfid:FE7F5F5C')['rsc_id']
>>> print arjan_id

Create a new thing on the website, which in this case is a photo of myself
>>> res = api.anymeta.attachment.create(data="@/Users/sysop/Desktop/pic.php.jpeg", mime="image/jpeg", title="Sicco!!")

print(res) will now give the following output, where the http links represent the page with the thing and the actual link to the photo:
{u'thg_id': 167419, u'rsc_uri': u'http://www.mediamatic.net//167419', u'attachment_uri': u'http://fast.mediamatic.nl/f/sjnh/image/552/167419-200-200.jpg'}

Add a tag to my picture. The ‘id’ is the ID of the picture, the ‘object’ the ID of myself, and I want myself tagged in the picture so I have the ‘predicate’ ACTOR. I could also have been an AUTHOR or like it, etc with other predicates.
>>> api.anymeta.edge.add(id=167419, object=143584, predicate='ACTOR')

These edges can thus be used to create all kinds of connections between things. For example I can create a ‘KNOWS_OF’ edge between myself and Peter when I use my own ID for the ‘id’ and Peter’s ID for ‘object’.
>>> api.anymeta.edge.add(id=143584, object=49557, predicate='KNOWS_OF')