MetaChat REGISTER   ||   LOGIN   ||   IMAGES ARE OFF   ||   RECENT COMMENTS




artphoto by splunge
artphoto by TheophileEscargot
artphoto by Kronos_to_Earth
artphoto by ethylene

Home

About

Search

Archives

Mecha Wiki

Metachat Eye

Emcee

IRC Channels

IRC FAQ


 RSS


Comment Feed:

RSS

14 June 2007

AskMecha: Madlib / random headline generator? [More:]
I've got a bunch of two-part fake headlines I want to combine randomly (at the click of a button) for my blog, like:

1
Man bites
Global warming caused by
Britons enraged by

2
Dog
Paris Hilton
Bush legacy

Etc. etc. The output needs to be a specific font (Capitolium) to match the typeface of the newspaper I'm trying to parody (de Volkskrant), so the output will probably be images (unless there's some magical way to do this in text).

Anyone got any ideas how to script this? Bunny wuv!
posted by goodnewsfortheinsane 14 June | 10:23
Oh, and bonus points if:

-it can be done without PHP
and
-the script allows for different n of the two categories (sentence parts), and "counts" how many items are in each category so I can add more at will without having to update the script.
posted by goodnewsfortheinsane 14 June | 10:25
Do you have the GD library on your server? (This is something that would run on your server, no?) What language are you hoping to write the script in, if not php?
posted by danostuporstar 14 June | 10:29
No, but GD looks pretty neat (you can tell I'm quite pedestrian when it comes to these things, because I hadn't heard of GD before). It requires PHP though, no?

Basically I was hoping for something like JavaScript to do the trick, because I'm a PHP noob.
posted by goodnewsfortheinsane 14 June | 10:32
If you created each letter as an individual image, you could have javascript put them together for you to form the headline.

But if you're actually creating the headline image on the fly, it would probably have to be server-side. Interfaces to GD are available in several languages besides php.

Re: "magical way to do this in text" ... does anybody know the status of browser support for CSS embedded fonts?
posted by danostuporstar 14 June | 10:40
Is Flash an option?
posted by danostuporstar 14 June | 10:43
Javascript alphabet sounds fine with me. Any clues as to how to code this up? The basic function should be trivial, but it needs to cope with the two-parter thing okay, and if the output could be overlaid on a generic newspaper front page that would be much spiffier.
posted by goodnewsfortheinsane 14 June | 10:43
Flash would be an option too, yeah.
posted by goodnewsfortheinsane 14 June | 10:46
My javascript skills are pretty rudimentary. There's lots of js gurus on AskMe. I bet you'd have better luck there.

The newspaper background could be set as the background image for the div that the headline appears in, via CSS.
posted by danostuporstar 14 June | 10:57
Did you ever sort this out? I could probably knock up something in Flash if you want.
posted by chrismear 15 June | 12:45
For real? That would be awesome. I got the alphabet converted to images and tried to write a [$letter]-to-[$corresponding image] JS script for it, but I think I suck, because it doesn't work.

I'm at work now, but I'd gladly send you the relevant stuff when I get home.
posted by goodnewsfortheinsane 15 June | 13:35
Cool, email's in profile.
posted by chrismear 15 June | 15:56
I'm afraid that email address bounces, Chris.
posted by goodnewsfortheinsane 16 June | 11:05
Ok, I Flickr-mailed you.
posted by goodnewsfortheinsane 16 June | 11:10
I'm tired of people asking me who is going to win the next Presidential election || Help name the new pooch!

HOME  ||   REGISTER  ||   LOGIN