- Joe Terranova - //www.joeterranova.net/blog -

Code Samples

Posted By joe On December 1, 2008 @ 2:23 am In | No Comments

VampMan, a character manager for Vampire: The Requiem

Project Link [1]

VampMan was created as the backbone of my now-defunct “Vampire the Rebirth” IRC game, as a direct competitor to the also-now-defunct Diablerie.org IRC game. The project consists of two modules: a module for PHP-Nuke, an ancient PHP CMS, and a module of PHP-IRC, an IRC bot written in PHP.

I’ve put up a shell of what the site was. You can see examples of the site in “action” here [2].

PHP-NUKE Module

  • Members can create characters, save characters, and finally submit characters for review when ready
  • Administrators can view all characters, edit characters, and review and approve proposed characters

PHP-IRC Module

  • Dice Roller. Random numbers are retrieved from your choice of Random.org, HotBits, or rand(), and stored in a cache for use as dice rolls.
  • Displayed descriptions of the characters and locations on command.
  • Tracked the use and expenditure of Vitae and Willpower, as well as damage taken.

NJIT Today

NJIT Today was my senior project at my university. The project was to create a feed aggregator, which would automatically update based on the feeds chosen. As well, old articles were to be stored in the database, so that a user could view the site as it was on a date in the past.

  • Fetched articles from RSS Feeds, the Flickr API, and custom feeds
  • Allowed for custom fetch, prepare, and schedule functions for feeds (see source for examples)
  • Allowed full customization of when data is fetched, and how old articles are removed.
  • Included a template for the web side, allowing you to have different templates for different time periods (see this date [3] vs this date [4]).
  • Allowed the ability to disable news items, as well as edit news items (see the top Google News article on this page [5]).
  • Front page stored statically, in order to handle large amounts of traffic

You can view a demo of the end result here [6]. The administrative side is available here [7]; the username is admin, the password is fluffy. Note that the database is restored from a backup every 2 hours.

Note that this was a two person project; my partner managed the project, created charts showing our progress and plan, wrote our final report, and did most of the Flickr integration. If you would like to see the coding breakdown, feel free to check out the svn repository from http://njit.joeterranova.net/njit2008/ and view the commit logs, or contact me.

The final code is available here [8]. It is released under the GPL v3, with permission of my partner and my NJIT project supervisor.

Miscellaneous Scripts

These are not full projects, but various scripts I’ve created.

RSS Feed Generator for DeviantArt

My girlfriend wanted to use an RSS feed for her Deviant Art galleries on her website. Strangely, Deviant Art does not have RSS Feeds (they’re perpetually listed as “coming soon”), so I created one. You can read more about it here [9].

Did I Win the Lottery?

This script automatically tells me if I’ve won the lottery. I put in my numbers, and the time range they’re good for, and it will email me at 1am the day after each drawing, telling me what my matches are. The code is available here [10]. Unfortunately, shortly after I wrote this script, a friend of mine made a much easier implementation: “echo ‘You did not win the lottery.’ | mail”

Traveler Sector Generator

I created a space sector generator for a game called Traveler, using the rules in Mongoose Publishing’s new version of the game [11]. This set of scripts allows you to generate a complete parsec, and all the worlds in it, including name, size, atmosphere, culture, what factions are on the planet, etc. The scripts can then output this information in the .sec file format, which you can use with tools such as sec2pdf [12]. The code is available here [13], and is released under the GPL v3. If you know PHP, just read parsec.php, and things should be pretty obvious. If you don’t, and want to use these scripts, feel free to contact me.


Article printed from Joe Terranova: //www.joeterranova.net/blog

URL to article: //www.joeterranova.net/blog/code-samples/

URLs in this post:

[1] Project Link: https://sourceforge.net/projects/vampman/

[2] here: http://vtr.joeterranova.net

[3] this date: http://njit.joeterranova.net/index.php?time=20080428

[4] this date: http://njit.joeterranova.net/index.php?time=19800101

[5] this page: http://njit.joeterranova.net/index.php?time=20080422

[6] here: http://njit.joeterranova.net

[7] here: http://njit.joeterranova.net/admin.php

[8] here: http://joeterranova.net/code/NJITToday.zip

[9] here: //www.joeterranova.net/2008/02/11/rss-feed-generator-for-deviantart

[10] here: http://joeterranova.net/code/winning.php.txt

[11] Mongoose Publishing’s new version of the game: http://www.mongoosepublishing.com/rpg/series.php?qsSeries=51

[12] sec2pdf: http://dotclue.org/t20/

[13] here: http://joeterranova.net/code/parsec.zip

Copyright © 2008 Joe Terranova. All rights reserved.