Getting Started with Smirk
To get started using Smirk, all you need to know is your UUID. Your UUID is always listed at the bottom of your Smirk page, it's that long string of letters and numbers after where it says, "Smirk UUID is:"
When working with the Smirk API, as long as you include a UUID, you will always get back the "Current Smirk" for a given user. You can usually also include an IID variable when you want to get to a specific smirk, but we'll talk more about that later.
Using Smirk: the basics
Embedding a Smirk with Flash
The simplest way to get a smirk to display is to copy and paste the embed code on your Smirk page directly into HTML or into a web interface that accepts HTML input (such as your MySpace profile). You can play with the width and height parameters as well to change the way it displays. The embed code on your Smirk page already includes your Smirk UUID so you don't have to do anything special to get it to work. Give it a try!
Embedding a Smirk with HTML and JavaScript
You can also use HTML and JavaScript to display your Smirks. This is slightly more complicated but a lot more flexible in different environments. This method uses a web standards based approach to display a smirk animation and doesn't require a browser plugin allowing smirks to display on devices without Flash support such as the iPhone. To use the JavaScript version of Smirk:
- Include this JavaScript on your page:
<script src="/js/smirk_animator.js" type="text/javascript"></script>
- Add a couple of classes to the HTML object you wish to become a smirk (this will usually be an image tag, but it doesn't have to be, it can be any HTML block element such as a DIV)
<img src="/images/no-smirk.jpg" class="smirktacular uuid-is-1627a31f573d57b55d5085a4179f1e4141a2392f loop-is-true" />

If you add these classes to a DIV or other HTML block element, that element's background CSS properties will be dynamically animated with your Smirk. This can have some interesting effects as in the example below where the background animation is able to tile. If you omit the loop-is-true class or set it to loop-is-false, your smirk will only animate on mouse-over. Have a look at the full API docs for more.
You can also source a specific Smirk for a user by adding the "iid-is" class as in the following example. Look for a user's IID at the bottom of their Smirk page next to their Smirk UUID.
<div class="smirktacular uuid-is-1627a31f573d57b55d5085a4179f1e4141a2392f iid-is-2840 loop-is-true" style="width: 500px; height: 170px;"></div>
URL Utilities
There are a couple of URL-based utilities for smirk as well:
Creating the JPG
/jpg.php?u=1627a31f573d57b55d5085a4179f1e4141a2392fwill always re-direct to a user's current smirk as a static jpeg image. You can use it as the source of an image tag like so:
<img src="/jpg.php?u=1627a31f573d57b55d5085a4179f1e4141a2392f">
Creating the GIF
/create_gif.php?u=1627a31f573d57b55d5085a4179f1e4141a2392fwill create an animated GIF image from a user's current Smirk. You can save this image and use it anywhere animated GIFs are supported, or use it as the source of an image tag to make the animation always reflect the user's current Smirk like so:
<img src="/create_gif.php?u=1627a31f573d57b55d5085a4179f1e4141a2392f">
We hope that you will find all kinds of interesting uses and mis-uses for smirk. Please email us with examples at hacks[at]mysmirks.com. Thanks for using Smirk!
Embed-able Icon - smirk.swf
At 19Kb, this is the light-weight way to display video icons to their fullest extent, without excess functionality, and without using the animated gif. This is what you'll use in place of the user's current static icon in your application, and it's what we use when a users embeds an icon on their blog, profile, or website.
FlashVars
External Interface
Maker - maker-v4.swf
Maker records new icons and works directly with Icon.swf to display the new icons in a grid.
FlashVars
- new: Create a new icon for a known user (requires a uuid)
- edit: Plays an icon and shows edit controls (requires a uuid & iid)
- play: Plays an icon and hides all controls (requires a uuid & iid)
External Interface
- new: Create a new icon for a known user (uuid must be known)
- edit: Plays an icon and shows edit controls (uuid & iid must be known)
- play: Plays an icon and hides all controls (uuid & iid must be known)
Icon - icon-v3.swf
These little guys buddy up with Maker to complete the circle in making, editing, and deleting video icons. They have the added functionality of setting the current icon, and deleting icons. As a user, they're what show up in the icon grid when you're logged in on your icons page.

