Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Use the Calais web service to summarize a Reddit or Twitter user's interests.
Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README
usermine.py

README

About
-----

usermine.py analyzes a user, returning a summary of what they've commented
on and URLs contained in their comments.

Analysis of comment text is done via the OpenCalais web service.

usermine.py works by:

1) Downloading the user's comment history from Reddit and/or Twitter

2) Going through the comments and, if the comment hasn't already been
   analyzed during a previous run, submitting the comment to the Calais web
   service

3) Summarizing the semantic data returned by Calais in either JSON or
   human-readable text.

Results are stored in a database file.

Installation
------------

The script requires python-calais, which can be found at:

  http://code.google.com/p/python-calais

You'll need an Open Calais API key, which you can request here:

  http://www.opencalais.com/APIkey

Examples
--------

Analyze Reddit comment history of user "mcantelon" and display as JSON:

  usermine.py -u mcantelon -a abcdefghijklmnopqrstuvwx -r

Analyze Twitter status updates of user "mcantelon" and display as human-
readable text:

  usermine.py -u mcantelon -a abcdefghijklmnopqrstuvwx -t -o

Analyze Twitter status updates of user "mcantelon" and display as human-
readable text in debug mode:

  usermine.py -u mcantelon -a abcdefghijklmnopqrstuvwx -t -o -d

Notes
-----

The Twitter status update fetching uses the search API which, unfortunately,
only retains the last week or so of Tweets.

You may want to run usermine.py in debug mode until you get your options right.

Usage
-----

Usage: usermine.py [options]

Options:
  -h, --help            show this help message and exit
  -u USER, --user=USER  specify username to investigate
  -a API_KEY, --api_key=API_KEY
                        specify OpenCalais API key
  -f FILE, --file=FILE  specify database file (default is
                        "usermine-<username>.db")
  -d                    display debug information during processing
  -r                    fetch comments from Reddit
  -t                    fetch comments from Twitter
  -o                    display output as human-readable text instead of JSON
Something went wrong with that request. Please try again.