dannyman.toldme.com

About Me : Free Style : Good Reads : News and Reaction : Photographs : Technical : Travels : Unsorted

Search:
August 12, 2004
Technical

lnk.to Progress Modest

I keep messing with how the database table should work, and I had a hard time figuring out how to create a new key within a class referring to an object that I am hash-tieing to the lnkto table with Tie::DBI, but the good news is, that I’ve actually gotten started. It is a little frustrating at the moment, but the knowledge that I am building a class that will make writing the actual web site so much easier is good for morale.

Oh, and I have tuned the rewrite rule so that it will be easier to add static HTML and additional cgi files to the site, because only URLs that match \w+ will get redirected:

    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteRule   ^/(\w+)$ /redirect.cgi?key=$1
    </IfModule>

So:
http://lnk.to/foo will be handled by redirect.cgi?key=foo
http://lnk.to/foo.html will read foo.html

Back to table concerns …

# DROP TABLE lnk;
CREATE TABLE lnk (
-- Unique numeric ID (auto-increment)
  `id` INT UNSIGNED NOT NULL auto_increment,
-- The URL key.  Not unique perse, but would be unique per chainId
-- Can be null, when we're first creating the Lnk.
  `key` VARCHAR(16),
-- The payload.  Definately not null!
  `url` TEXT NOT NULL,
-- "publication date" of an item
  `pubDate` DATETIME,
-- date item added to Lnkto
  `addDate` DATETIME NOT NULL DEFAULT 'NOW()',
-- HTML TITLE tag but should be user-editable
  `title` VARCHAR(128),
-- META description
  `description` TEXT,
-- We'll eventually handle "add from feed" type chains ...
-- 'hilite' is an idea where you could hilite a Lnk into your own chain
-- ... basically a reference thingus
  `source` ENUM('feed', 'manual', 'hilite') DEFAULT "manual" NOT NULL,
-- Which chain we belong to.  For now, only 0
  `chainId` INT UNSIGNED DEFAULT 0 NOT NULL,
-- Numeric ID of "author" which will ref another table, with author
-- name, email, etc.  Can be useful for "tipping" and some day crafting
-- suggested reading
  `authId` INT UNSIGNED DEFAULT 0 NOT NULL,
-- For classic lnk.to, we like to keep score, which is roughly +1 per
-- clickthrough, divided by 2 every night.
  `score` FLOAT UNSIGNED DEFAULT 1 NOT NULL,
  UNIQUE (
    `id`
  )
);

It is a work in progress.

Oh, and Firefox “tab sessions” rock, because you can create a “dev” window with a bunch of appropriate tabs in there, and then save that tab set in a session when you go home, and reload it the next day. A great complement to the screen command!

Another note, it may be a very healthy work style to comment on progress here in the morning, and let the hindbrain think about things during the day. I do the dev work “after work” at the office, after 3pm, when my shift formally ends. (Though, I’ll still kick the occasional work ticket when I need a break.)

Read More

Next: dotPhoto: Very Good, Inexpensive Digital Printing
Previous: You Call This August?
Categories: Technical
Possibly-Related Posts
Spam, Spam, Sausage, Eggs …
Bleak
TIP: Manage Infinite Passwords
Spam Count, Mail Config
Linux Uptime Reset
Red Hat Rant
WordPress 2.5.1

Comment / Tip

. . . or leave a Tip

Leave a comment . . .

  1. You must provide an e-mail address.
  2. First-time comments will be held for review.
  3. Bogus e-mail addresses are lame, but will work.
  4. For private messages, e-mail me: dannyman@toldme.com.
  5. I will not spam you, and I will not publish or share your e-mail address.

Danny Howard is 100% responsible for the content on this site, except some of it is stolen.

All rights are reserved, unless otherwise noted. Generally, I'm a BSD guy, so you can assume implicit permission to adapt, modify, and redistribute my intellectual property with appropriate attribution. Except some of this content is itself re-appropriated, so you'd best ask first, especially for commercial use. Thanks!

You can contact me via e-mail: dannyman@toldme.com

Most of http://dannyman.toldme.com/ is powered by WordPress.

If you're hip to RSS and whatnot, you can subscribe to this site.

These links are for dannyman: login AND backlinks