Sniff is a marketing campaign tracker. It shortens any given URL, and tracks who / when / where / how the link is clicked.
- Shortens the URL
- Logs browser info
- Logs geographic info
Sniff runs on Python 3. It requires flask, requests and LeanCloud Python SDK.
Sniff is a LeanCloud app. Before getting the code up and running, there're some chores to do.
- Create an app on LeanCloud dashboard, and set a domain name for the app.
- Set environment variable
FLASK_SECRET_KEY
in the LeanCloud dashboard. Refer to this on how to make a good solid secret key. - Install LeanCloud CLI. It's not required, but is highly recommended.
Clone this repo, type lean login
then lean checkout
to link your local repo to the LeanCloud app you've just created.
Use virtualenv to create a virtual environment for this app. Activate the virtual environment, then use pip
to install the requirements.
Use lean deploy
to deploy the code onto the cloud. After that, visit the site with the domain name you set before.
In short:
$ git clone https://github.com/nervouna/Sniff.git
$ cd URL-Shortener
$ virtualenv venv --python=python3
$ source venv/bin/activate
$ pip install -r requirements.txt
$ lean login
$ lean checkout
$ lean deploy
Check out the data in the LeanCloud dashboard. All the URLs are stored in the Shortened
class, and the visitor footprints are stored in the Visits
class.
Note: For now you'll have to add users in LeanCloud dashboard.
You can always use lean up
to fire up a debuggable instance on your machine, and visit it via http://127.0.0.1:3000
by default.
- QRCode for short links
- Export data in CSV
- Browser plugins
- 🤔 Full-functioning dashboard
License: WTFPL
Author: GUAN Xiaoyu (guanxy@me.com)