Saturday, September 15, 2012

TextHole

To experiment with Google Appengine I've created a simple text repository application called TextHole.

TextHole is a basic text repository with the following features:

  • Anonymous uploads and read access
  • Optional Google OAuth2 authentication to allow you to delete or edit your uploads
  • A simple JSON interface makes it easy to post and download text from other sites
To download text via JSON make a GET request to http://texthole.arkem.org/download/[mesage_id]
The reply will be a JSON dictionary with the following keys:

body: the text body of the message
editable: whether the requestor can modify the text
creation: Creation time of the text
expiry: unix timestamp of the expiry of the text
message_id: the message id of this text
status: True if the request succeeded
error: If status is false more details here

Note: Only status and message_id fields are guaranteed

To upload text via JSON make a POST request to http://texthole.arkem.org/upload providing a JSON dictionary via the data form field. 

Possible actions are:
New message: The body key is required
Delete: The delete key is required
Edit message: The body and overwrite keys are required

Request dictionary keys:
body: the text body of the new/modified message
delete: the message id of the message to delete
overwrite: the message id of the message to edit
authenticated: if set attribute the new message to the user
expiry: number of seconds (max 1yr) the text is to be valid for

Notes: One of body and delete is required. Overwrite and delete require a valid cookie to be sent with the request.

Reply dictionary keys: 
message_id: the message id of the new/edited/deleted text
status: True if the request succeeded
error: If status is false more details here
expiry: unix timestamp of the expiry of the text
user: username of the owner of the text ("None" for anonymous)

TextHole is missing the following features (maybe coming soon):
  • An index of available texts
  • Text search
  • A javascript client library to make it even easier to integrate with TextHole
  • A way to authenticate via the JSON library
Please play around with TextHole and send me any bugs or ideas that you find. Please remember that everything in TextHole is public, I can see it, and so can everyone else. Finally, please don't use TextHole for evil.

No comments:

Post a Comment