Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

TypePad dashboard reader and leaderboard.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 sql
Octocat-spinner-32 static
Octocat-spinner-32 templates
Octocat-spinner-32 tools
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Makefile.PL
Octocat-spinner-32 README.markdown
README.markdown

Tiptop

Tiptop is an alternate reader for the top content in your TypePad dashboard. Rather than a stream of all of the events generated by people you follow (posts, favorites, comments, &c), tiptop gives you a couple of views into that content:

  1. A list of posts, photos, videos, &c created by the people you follow
  2. A leaderboard of the most-favorited posts, photos, videos, &c

And, in the future, maybe more. Its aim is to serve both as a reference application for building upon the TypePad platform, as well as a genuinely useful reader for the content you should be reading from people you follow.

Installing Tiptop

Tiptop itself is pure Perl, but it has a number of dependencies beyond core Perl. You can guarantee that those dependencies are installed by running the Makefile.PL, which will complain for all dependencies that aren't installed.

Tiptop also requires a MySQL or SQLite database to store post & user content locally. The schema for that database is in tiptop.mysql or tiptop.sqlite in sql/ directory:

mysql -u username tiptop < sql/tiptop.mysql
sqlite3 tiptop.db < sql/tiptop.sqlite

Configuring Tiptop

Tiptop's configuration is stored in the tiptop.cfg file. At a minimum, the database and user configuration (information about the user whose followers you'd like to track, which is probably you) is required. Here's a sample configuration file, which should live in tiptop.cfg in your application root:

[database]
dsn=dbi:mysql:database=tiptop
# dsn=dbi:SQLite:dbname=tiptop.db
username=username
password=password

[user]
xid=6p00d83455876069e2

Running Tiptop

Tiptop is composed of a couple of components:

  1. Command-line tools (load-events.pl, poll-favorited-by.pl)
  2. A PSGI-based web application

To test your configuration, you can first start up the web application:

bin/tiptop-web

Then navigate to the webserver in your browser (it runs on port 5000 by default):

http://localhost:5000/

tiptop-web is simply a wrapper around the plackup tool, so you can use any of the command-line options supported by that tool when running tiptop-web, as well.

To load content into your database, run load-events.pl: this will poll TypePad for new events created by your followers, and will create local copies of the user and asset objects for fast access in the future:

perl tools/load-events.pl

This could take a little while the first time it runs, if you have a lot of events in your dashboard history (the maximum number of events is 1,000); on future invocations, though, load-events.pl will only look back through your events until it finds events that it's previously processed, so it'll be faster.

load-events.pl will only load favorites and assets by people that you follow. You might also want to factor in favorites from users that you don't follow when they happen to favorite assets from people you follow (or assets favorited by people that you follow). To backfill favorites from all users for the assets that load-events.pl has discovered, you can run poll-favorited-by.pl:

perl tools/poll-favorited-by.pl

For each asset in your local database, this will query the list of favorites for that asset and backfill them in your database, giving you a complete list of users that have favorited each asset.

License

Tiptop is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Author

Benjamin Trott / ben@sixapart.com

Something went wrong with that request. Please try again.