Add-on that enables sharing of Hackasaurus hacks.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 7 commits behind toolness:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

This is a server and accompanying Firefox add-on that make it easy to share Hackasaurus hacks. Presently, hacks are shared by posting a screenshot to Flickr, and optionally uploading a replica of the hacked page.


For the add-on:

For the server:

  • Python 2.5 or greater (but not Python 3.0 or greater)

The full list of server-side dependencies are in the file server/requirements.txt, but these are usually installed automatically by a bootstrap script, so you don't need to worry about them.

Server Setup

First, run these commands from the root of your checkout:

$ cd server
$ python bootstrap

Then, create server/dev/ and fill it with something like the following:

FLICKR_API_KEY = 'myapikey'
FLICKR_API_SECRET = 'mysecret'
FLICKR_AUTH_TOKEN = 'myauthtoken'
UPLOAD_AUTH_TOKEN = 'somebiglongsecret'
STATIC_HACKS_ROOT = '/var/static-hacks/'
STATIC_HACKS_URL = 'http://localhost:8001/'

The FLICKR_API_KEY and FLICKR_API_SECRET values are provided to you when you create a new Flickr application on the Flickr website.

The UPLOAD_AUTH_TOKEN setting is also included in the add-on configuration to authenticate it with the server. This can be whatever you want, as long as the server and client are both configured with the same value.

The FLICKR_AUTH_TOKEN setting is particular to a specific Flickr user; all hack screenshots are uploaded as this user. To obtain it, run:

$ python flickr_auth

Follow its instructions. Once it finishes, it will present you with a value that you can use for FLICKR_AUTH_TOKEN.

The STATIC_HACKS_ROOT setting is the root directory that will contain static HTML and CSS files for each hack. The corresponding URL serving static files under this directory is named by STATIC_HACKS_URL. Note that the development server doesn't actually expose these files; for now, you'll need to set up a separate server to serve them.

Once you've finished setting up the server configuration file, run:

$ python runserver

Add-on Setup

First, create addon/data/config.json and fill it with something like the following:

    "auth_token": "somebiglongsecret",
    "goggles_server": "",
    "upload_server": "http://localhost:8000/upload/",

The value of auth_token should be identical to the UPLOAD_AUTH_TOKEN setting on the server.

The goggles_server setting points to a hosted instance of the Web X-Ray Goggles.

The upload_server setting points to the location of the server component.

Run cfx run to launch an instance of Firefox with the add-on installed. You should be able to click on the widgets on the add-on bar to activate the goggles and share your hacks.