ip60:~ sysop$ any-registry any-registry 1.22 Usage /usr/local/bin/any-registry [opts] [cmdoptions] Command is one of: list - List all registry entries gui - Show graphical user interface (linux only) add - Add API endpoint del - Remove API endpoint cli - Commandline interface ip60:~ sysop$ sudo easy_install AnymetaAPI ip60:~ sysop$ ip60:~ sysop$ ip60:~ sysop$ any-registry add mymediamatic http://www.mediamatic.net/ Registry: /Users/sysop/.anymeta ************************************************************ Please go to the following URL to authorize your request. When you're done, press ENTER here to finish. >>> http://www.mediamatic.net/module/OAuth/authorize?oauth_token=8656c4f1785559f9f4806ecc47a6b88b04ce54c3b ************************************************************ Saving... done! OK ip60:~ sysop$ any-registry list Registry: /Users/sysop/.anymeta mymediamatic - http://www.mediamatic.net/services/rest/ OK ip60:~ sysop$ any-registry cli mymediamatic Registry: /Users/sysop/.anymeta Use the 'api' python variable to access mymediamatic (http://www.mediamatic.net/services/rest/) Logged in as Arjan Scherpenisse. >>> >>> >>> print api >>> print api.anymeta.user.info() {u'auth_info': {u'usa_email': u'arjan@scherpenisse.net', u'usa_modify_date': u'2010-06-02 16:35:00', u'usa_logon_date': u'2010-11-18 16:55:25', u'usa_axo': u'public', u'usa_access_date': u'2010-11-18 16:55:25', u'usa_enabled': u'1', u'usa_axo_section': u'content', u'usa_email_sha1': u'5484271baf83a08a906ec82728c73ae3a4b28ce8', u'usa_confirm_logons': u'0', u'usa_create_date': u'2007-09-20 19:29:29', u'usa_id_ref': u'22661', u'usa_confirm': u'', u'usa_prev_logon_date': u'2010-11-18 16:55:25'}, u'preferences': {u'notifications': {u'blacklist': {u'Message': {u'0': u'http://mediamatic.nl/ns/anymeta/2010/activitystreams/link-to'}}}, u'anymeta': {u'language': u'en'}, u'facebook': {u'session': {u'uid': u'585138714', u'access_token': u'beeeh', u'expires': u'0', u'secret': u'ikdachthetniet', u'sig': u'gfdgf', u'session_key': u'29003b9fdeea45273279f5bb-585138714'}}}, u'title': u'Arjan Scherpenisse', u'id': u'22661', u'axo': [u'content', u'public'], u'aro': [{u'id': u'15', u'name': u'system administrators'}]} >>> arjan = api.anymeta.user.info() >>> >>> >>> >>> from pprint import pprint >>> self = arjan >>> pprint(self) {u'aro': [{u'id': u'15', u'name': u'system administrators'}], u'auth_info': {u'usa_access_date': u'2010-11-18 16:55:25', u'usa_axo': u'public', u'usa_axo_section': u'content', u'usa_confirm': u'', u'usa_confirm_logons': u'0', u'usa_create_date': u'2007-09-20 19:29:29', u'usa_email': u'arjan@scherpenisse.net', u'usa_email_sha1': u'5484271baf83a08a906ec82728c73ae3a4b28ce8', u'usa_enabled': u'1', u'usa_id_ref': u'22661', u'usa_logon_date': u'2010-11-18 16:55:25', u'usa_modify_date': u'2010-06-02 16:35:00', u'usa_prev_logon_date': u'2010-11-18 16:55:25'}, u'axo': [u'content', u'public'], u'id': u'22661', u'preferences': {u'anymeta': {u'language': u'en'}, u'facebook': {u'session': {u'access_token': u'jkljkljlk', u'expires': u'0', u'secret': u'hjklhjkl', u'session_key': u'hjkhk-585138714', u'sig': u'4408e4a07af954674d8f65fca17151fe', u'uid': u'585138714'}}, u'notifications': {u'blacklist': {u'Message': {u'0': u'http://mediamatic.nl/ns/anymeta/2010/activitystreams/link-to'}}}}, u'title': u'Arjan Scherpenisse'} >>> print self['title'] Arjan Scherpenisse >>> >>> api.identity.identify(type='rfid', raw='urn:rfid:FE7F5F5C') {u'subtitle': u'new media artist, researcher, developer.', u'name': {u'full': u'Arjan Scherpenisse', u'last': u'Scherpenisse', u'gender': u'm', u'id_ref': u'22661', u'short': u'Arjan', u'first': u'Arjan'}, u'keyword': [u'Games', u'New media', u'A.I.', u'Science', u'Computer', u'Electricity', u'Software', u'unstability', u'Information', u'Anymeta', u'Open Source', u'Perception', u'Electronic'], u'title': u'Arjan Scherpenisse', u'authoritative': u'1', u'rsc_id': u'22661', u'intro': u'Besides being an Unstable Media student at the Gerrit Rietveld Academie, I work at Mediamatic Lab as software engineer. In this role I work on the anyMeta system, on fancy new technologies like XMPP and OpenID, and as general techie with the Mediamatic Foundation.\n \nMy main interests are new media and technology (both software and hardware) and its relation to art. Keywords: soldering, A.I., max/msp/pd, ipod touch, wiimote, software development, OpenCV, OSC, Processing, face recognition.', u'rsc_uri': u'http://www.mediamatic.net//22661', u'modify_date': u'2010-11-18 14:01:26', u'address': {u'website': u'http://www.scherpenisse.net/', u'city': u'Amsterdam', u'im_type': u'msn', u'work': {u'phone_normalized': u//, u'email_sha1': u//, u'mobile': u//, u'phone': u//, u'email': u//, u'mobile_normalized': u//}, u'phone_normalized': u'+31641322599', u'email_sha1': u'5484271baf83a08a906ec82728c73ae3a4b28ce8', u'mobile': u'+31641322599', u'country': u'nl', u'id_ref': u'22661', u'line1': u'Tugelaweg 94-B', u'phone': u'+31641322599', u'im': u'acscherp@hotmail.com', u'postcode': u'1091 VP', u'email': u'arjan@scherpenisse.net', u'mobile_normalized': u'+31641322599'}, u'imageurl': u'http://fast.mediamatic.nl/f/sjnh/image/530/27597-480-480-crop.jpg'} >>> pprint(api.identity.identify(type='rfid', raw='urn:rfid:FE7F5F5C')) {u'address': {u'city': u'Amsterdam', u'country': u'nl', u'email': u'arjan@scherpenisse.net', u'email_sha1': u'5484271baf83a08a906ec82728c73ae3a4b28ce8', u'id_ref': u'22661', u'im': u'acscherp@hotmail.com', u'im_type': u'msn', u'line1': u'Tugelaweg 94-B', u'mobile': u'+31641322599', u'mobile_normalized': u'+31641322599', u'phone': u'+31641322599', u'phone_normalized': u'+31641322599', u'postcode': u'1091 VP', u'website': u'http://www.scherpenisse.net/', u'work': {u'email': u'', u'email_sha1': u'', u'mobile': u'', u'mobile_normalized': u'', u'phone': u'', u'phone_normalized': u''}}, u'authoritative': u'1', u'imageurl': u'http://fast.mediamatic.nl/f/sjnh/image/530/27597-480-480-crop.jpg', u'intro': u'Besides being an Unstable Media student at the Gerrit Rietveld Academie, I work at Mediamatic Lab as software engineer. In this role I work on the anyMeta system, on fancy new technologies like XMPP and OpenID, and as general techie with the Mediamatic Foundation.\n \nMy main interests are new media and technology (both software and hardware) and its relation to art. Keywords: soldering, A.I., max/msp/pd, ipod touch, wiimote, software development, OpenCV, OSC, Processing, face recognition.', u'keyword': [u'Games', u'New media', u'A.I.', u'Science', u'Computer', u'Electricity', u'Software', u'unstability', u'Information', u'Anymeta', u'Open Source', u'Perception', u'Electronic'], u'modify_date': u'2010-11-18 14:01:26', u'name': {u'first': u'Arjan', u'full': u'Arjan Scherpenisse', u'gender': u'm', u'id_ref': u'22661', u'last': u'Scherpenisse', u'short': u'Arjan'}, u'rsc_id': u'22661', u'rsc_uri': u'http://www.mediamatic.net//22661', u'subtitle': u'new media artist, researcher, developer.', u'title': u'Arjan Scherpenisse'} >>> >>> >>> arjan_id=api.identity.identify(type='rfid', raw='urn:rfid:FE7F5F5C')['rsc_id'] >>> print arjan_id 22661 >>> result = api.anymeta.attachment.create(data="@/Users/sysop/Desktop/arjan.jpg", mime="image/jpeg", title="Arjan looking gooooooood!") >>> result {u'thg_id': 167417, u'rsc_uri': u'http://www.mediamatic.net//167417', u'attachment_uri': u'http://fast.mediamatic.nl/f/sjnh/image/557/167417-640-480.jpg'} >>> pprint(result) {u'attachment_uri': u'http://fast.mediamatic.nl/f/sjnh/image/557/167417-640-480.jpg', u'rsc_uri': u'http://www.mediamatic.net//167417', u'thg_id': 167417} >>> picture_thing=result['thg_id'] >>> print picture_thing 167417 >>> >>> >>> >>> >>> >>> >>> print picture_id Traceback (most recent call last): File "", line 1, in NameError: name 'picture_id' is not defined >>> print picture_thing 167417 >>> print arjan_id 22661 >>> api.anymeta.edge.add(id=167417, object=22661, predicate='ACTOR') {u'predicate': u'ACTOR', u'date_start': None, u'title': u'Arjan Scherpenisse', u'edg_id': u'1187613', u'date_end': None, u'object': u'22661', u'title_short': u'', u'value': None, u'predicate_id': u'9967', u'kind': u'PERSON', u'order': u'9999', u'subject': u'167417'} >>> api.anymeta.edge.add(id=167417, object=49557, predicate='ACTOR') {u'predicate': u'ACTOR', u'date_start': None, u'title': u'Peter Robinett', u'edg_id': u'1187630', u'date_end': None, u'object': u'49557', u'title_short': u'', u'value': None, u'predicate_id': u'9967', u'kind': u'PERSON', u'order': u'9999', u'subject': u'167417'} >>> api.anymeta.edge.add(id=22661, object=49557, predicate='KNOWS') {u'predicate': u'KNOWS', u'date_start': None, u'title': u'Peter Robinett', u'edg_id': u'1187642', u'date_end': None, u'object': u'49557', u'title_short': u'', u'value': None, u'predicate_id': u'126491', u'kind': u'PERSON', u'order': u'9999', u'subject': u'22661'} >>> api.anymeta.edge.add(id=22661, object=49557, predicate='KNOWS_OF') {u'predicate': u'KNOWS_OF', u'date_start': None, u'title': u'Peter Robinett', u'edg_id': u'1187645', u'date_end': None, u'object': u'49557', u'title_short': u'', u'value': None, u'predicate_id': u'8', u'kind': u'PERSON', u'order': u'9999', u'subject': u'22661'} >>> api.anymeta.edge.add(id=22661, object=49557, predicate='KNOWS_OF')