Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Sync localstorage across multiple browsers
PHP JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
conf
lib
.gitignore
.gitmodules
.htaccess
README.md
compat.js
index.php
sync.php
test.html
wolk.js
wolk.sql

README.md

About

Wolk is an attempt to implement some sort of syncing HTML5's localStorage across multiple browsers with as little hassle as possible. The client could be implemented as a javascript library or a browser extension, the server side is written in PHP and should work on a simple shared hosting account.

Set up

Getting all the code

Since this repository depends on another repository, namely lightopenid, you will need to take some additional steps to get the submodules:

git clone git://github.com/jelmervdl/wolk.git
git submodule init
git submodule update

Configure database

Just copy conf/db.php.default to conf/db.php and provide your mysql credentials and a database name. Use wolk.sql to create the tables. Or as explained in command-line terms:

$ mysql
mysql> CREATE DATABASE wolk;
mysql> connect wolk
mysql> source path/to/wolk.sql
mysql> CREATE USER 'wolk'@'localhost' IDENTIFIED BY 'wolk';
mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON wolk.* TO 'wolk'@'localhost';    

API

todo

Read data

GET request.
Required parameters: api_key
Optional parameters: namespace, since

Sync data

POST request Required parameters: api_key
Optional parameters: namespace, since
Supply key-value-modified pairs as JSON in the request's body.

In addition to saving data in the wolk this request will return the same data as a GET request would have. This is by design so syncing can be done with a single request by pushing all the changes since the last sync and supplying the since parameter to receive all the changes you missed out on.

You will have to do the bookkeeping yourself (i.e. keep track of whether your version of a key-value-pair is newer than the received version) For this pushing part this is done by the database for you. So when you send old data, it will never overwrite newer data already in the wolk.

Something went wrong with that request. Please try again.