Social listening made easy
Install using pip…
pip install django-chatterbox
Add ‘chatterbox’ to your INSTALLED_APPS setting.
INSTALLED_APPS = ( 'chatterbox', )
Append urls to urls.py
urlpatterns = patterns( (r'^chatterbox/', include('chatterbox.urls', namespace="chatterbox")), )
Video demo here.
Go to instagram: https://instagram.com/developer/clients/manage/ and register an App
Once you have the app created, go here: /admin/chatterbox/client/add/
Fill out all Client model info using key/secret from instagram.com
- Once the Model is created, click on it in the admin. Should look like this:
Select the permissions you require (most likely just read permissions)
Click ‘get authorization’
Follow the prompts redirecting you back to the admin
You now have a key model added to the admin
Next lets create a job, go here: /admin/chatterbox/job/add/
Select Instagram, Instagram tag search, highlight your key, add a search term
You now have everything you need to run a job. Lets execute it!
./manage.py shell from chatterbox.models import Job jobs = Job.objects.all() job = jobs job.run() # you will see...lots of stuff happen :)
How does it work?
Chatterbox comes with a few built in models and features. Here is a quick run down of what you all get…
A service is basically a social network and it’s associated interactions. Chatterbox ships with 4 services out the box: Facebook, Twitter, Instagram, and YouTube. Additional services will likely be added but this is what comes for free atm.
Each service has an associated driver which is the underlying code used to interact with that social nework.
If you have ever worked with any of the social networks you know that to interact with it, you need to go grab a key/secret for that social network. Chatterbox clients are the model representation of that key and secret.
Keys are the result of a client and a user. Once a Client is created, you use that client to authenticate a user and create a key. This key has an access token attribute on it used to make outgoing requests.
Chatterbox ships with a few built in collectors. Think of collectors as the thing that goes out, collects the social activites, and then saves them. For every social networks possible collection point, we have build out a collector. ex: i want to search instagram for all activites flagged with the hash #cheese. This would use the collector ‘Instagram Tag Search’
A job is everything you need to go out, grab data, and bring it back. A job holds a collector, key, and any associated arguments needed to query that social network.
Activities are what is returned from each social network. It holds a normalized ‘blob’ object on it (among other things) that can be used to access all associated social response
Added Tumblr support Added Twitter user search
API Changes Bugfixes