This page provides a simple data explorer which lets you spelunk through data stored on blobastorus.
including the library
The first step to using blobastor.us is including the javascript library:
<script type="text/javascript" src="https://blobastor.us/api.js"></script>
api
NOTE: This API is in, like, PRE-ALPHA. That means it will likely change lots and lots.
After including the blobastorus javscript library, a top level object will be created which supports the following functions:
basic functions
Blobastorus.getUser(callback);
Get the currently authenticated user. The callback has arguments (username, error). If error is non-null, this indicates the call was a failure. If no user is currently authenticated error will be the string "needsAuth". Otherwise the username parameter will contain a string which is the twitter id of the currently authenticated user.
Blobastorus.redirectUser([return_to]);
Redirect the user to twitter for authentication. Optionally, a return_to parameter may be supplied which is a url that the user will be directed to after authentication is complete.
This function will overwrite document.location and hence will not return. If you would rather do something more snazzy, you can manually send your user to:
https://blobastor.us/auth/?kickback=http://mysite.com
The value of kickback is the site that the user should be sent back to once authentication is complete.
Blobastorus.getBlob([args], callback);
Get a JSON blob. args is an optional argument which may contain the following properties:
- domain
- the domain for which the blob should be fetched, defaults to current domain.
- scope
- the 'scope' for which the blob should be fetched, defaults to current scope.
- user
- the user for whom the blob should be fetched, defaults to currently authenticated user.
The callback has arguments (blob, error). when error is non-null there was a problem fetching the blob, and error contains a textual error code. Otherwise, blob will contain the fetched data.
Blobastorus.setBlob(blob, [callback]);
Set the user's blob for the current domain, current scope (see .setScope()), and currently authenticated user (see .getUser()).
The callback has arguments (error). When error is non-null there was a problem setting the blob, and error contains a textual error code.
Blobastorus.listUsers([domain], [scope], callback);
List users who have stored blobs. Defaults will be current domain and scope. If a single argument is supplied it will be interpreted as a scope (not a domain).
data scoping
Blobastorus.setScope(scope);
Set the "data scope" for all subsequent calls during the current session. The scope argument must be a string which matches /[a-zA-Z0-9]+/. Scoping data allows you to host multiple applications on the same domain which use blobastor.us without having them collide.
exploration
Blobastorus.listDomains(callback);
List all domains for which data is stored. The callback has arguments (domainArray, error). domainArray is an array of strings representing domains for where data is stored in blobastor.us. When error is non-null this indicates there was a problem acquiring the list of domains and error contains a textual error code.
Blobastorus.listScopes([domain], callback);
List the available data scopes within a domain. If the domain parameter is omitted, defaults to current domain. The callback has arguments (scopeArray, error) scopeArray is an array of strings representing scopes under the specified domain where data is stored in blobastor.us. When error is non-null this indicates there was a problem acquiring the list of scopes and error contains a textual error code.
error codes
Wherever there's an error argument to a callback, it holds a string error code. The only error code that's interesting to handle programatically is needsAuth which indicates that no user is logged in. The client application should, in this case, call .redirectUser().
blobastor.us is a free data storage service that is optimized for HTML5 web applications. The service is designed to be interfaced from javascript in the browser and to eliminate the need for a server component for most little HTML5 apps. Twitter is used to provide authentication and user identity.
The goal of the project is to make it easier and faster to build small standalone social applications using web technologies.
how it works
Client code includes a little javascript library which provides access to blobastor.us servers via a smallish asynchronous API. Using this library apps can efficiently query and store data that is scoped to their domain. The key ideas are:
- All data stored in the system is publically visible.
- Only users with valid twitter accounts may store data.
- users own their data and no changes can be made without a valid identity
- Data is scoped by both 'domain' and a logical 'scope', so that multiple apps may peacefully co-exist.
- Storage space is limited to 20k per user per domain.
the service
blobastor.us is free to use, and the code that fuels it is open source. The service comes without any warranty and may change without any notice. But then, if you come to rely on this service, and it dies, you can always take the code and build your own blobastor. Roar!
feedback
cred
This application was conceived of by Atul Varma, and is a remix of his twitblob service.
The name Blobastorus was inspired by the Brontosaurus, a creature that never was.
The mascot image is a remix of a picture taken by flickr user, walker_hamilton.
Lloyd wrote blobastor.us.