Dave Winer posted earlier today about Building TwitterGram into a really big thing!. As part of the discussion, he stated that we need to figure out a way to provide Payloads for Twitter.
Here is my suggestion for doing this on our own (no divine intervention by ev needed):
Short Answer
- Lets use YAML
Quick Example of YAML Enclosure
--- My Test Tweet Text
url: http://tinyurl.com/XXXX/
type: mp3
Long Boring Answer
I’m approaching this from the standpoint that what we’re talking about is “Podcasting over Twitter”, so lets take lessons learned from that.
Podcasts are achieved via the inclusion of the
Each application reading a RSS feed with an enclosure element decides how it is to be treated. A web based app might lookup the enclosure URL and present the user with a flash widget for playing the podcast right off the webpage, while a desktop app might download the file in the background and sync it to an iPod.
Twittercasting
If Twitter is blogging-lite then YAML is XML-lite and I think ideally suited to our task.
| YAML Tweet Template Guide: | ||
|---|---|---|
| YAML Element | Status | Notes |
| — | Required | Three dashes indicate the start of a YAML Document |
| Tweet Text | Required | Some Text to indicate what the file is about, can be considered equivalent to link text or a title. |
| URL Hash | Required | Key “url” is always lowercase and immediately followed by a colon “:” and a space ” “. Value is a valid HTTP url. Due to Tweet size limits it’s recommended that you use a URL shortening and redirection service. |
| File Hash | Required | Key “type” is always lowercase and immediately followed by a colon “:” and a space ” “. Value is the file extension of the file referenced in the URL hash. It is recommended to use a three digit file extension in the interests of saving space. |
Twittercast YAML Template:
--- [Tweet Text]
url: [URL Value]
type: [File Extension]
Example One:
--- Phoned-in TwitterGram
url: http://tinyurl.com/yqxfl6
type: mp3
Example Two:
--- Diggnation Video
url: http://tinyurl.com/YYYY/
type: mov
Why this is Good Stuff
- Format Agnostic => It won’t matter what type of file / media is specified.
- Structured / Programmable => Libraries for YAML available for most programming languages and if they aren’t the subset of the format we are using is so small that it could easily be manually parsed.
- We can start publishing these RIGHT NOW => No Twitter publishing tool has support for Twittercast enclosures, but they are so simple they can easily be entered manually with writing tools later offering better services options for their automatic creation.
- We can start receiving these RIGHT NOW => No Twitter client (SMS, Twitterrific, etc.) currently has an option for adding a slick “play now” button into their interface, or auto-downloading Twittercasts to the iPhone, but the URL will work and the recipient gets more value today because at least now they get the type of media file it is so they can make a choice about clicking the link. Down the road, Twitter clients can add helpful UI features like media type indicators, previews, etc.
Possible Issues
- YAML Key Value pairs are supposed to be separated by a newline character and this doesn’t make it through posting a Tweet. An alternative option is to enclose both the url and type pairs in curly braces, but frankly that looks to “code” like.
- In my examples I’m specifying the type as the file extension (instead of the formal MIME Type, eg. in RSS Enclosure the type is specified like “audio/mp3″), this isn’t ideal for a number of reasons but may well be “good enough” to work as is.
Any thoughts or ideas appreciated.

WHAT TO DO NOW?