Archive for the ‘css’ Category

Links + This Week

Posted by admin

Couple of links to share this morning of my content elsewhere. The latest Ask Smashing Magazine is up with loads of questions on CSS answered by me. Also Chris Spooner interviewed me on Line 25 about my past, blogging, and getting ideas.

As a quick note: I’m out on vacation this week Wednesday through Sunday, and I’ll be totally off the grid. I do have some articles lined up though. Tuesday I’ll be posting a journey through the applications I use during the course of day. Wednesday I hope to do a review of what CSS overflow is, how it works, and what it is used for. Then regular posting will resume the following week.

Quotes on Design API v2.0

Posted by admin

I know at least a couple of you ended up using the original Quotes on Design API. It was kind of an experiment, but it did the trick in that it was an easy way to quickly add random design-related quotes to any site, with full CSS control.

It’s major weakness was that on every single page load on every single site using it, it had to hit the database. It was a tiny and quick query, but still, not a very efficient thing to do.

I have now updated it to v2.0, which works about the same way, but is far snappier.

Changes

  • Change to ID name on wrapping div (to a more specific “qod-quotes”)
  • Faster loading
  • Only changes quotes every 2 minutes

What I Did

Instead of having the JavaScript (actually PHP in disguise) hit the database every time, it simply loads the quote content from a text file. This text file’s contents is overwritten by a script that reads a random quote from the database every 2 minutes (a CRON job on the server fires it off). This, I believe, is known as “ghetto caching“.

Future

As I learn more about this stuff, I’d like to ultimately have some options for what it returns. JSON or XML is a strong possibility. Some pre-formatted options are also a possibility.

Using It

This is all there is to it:

<div id="qod-quote">
    ... loading ...
</div>
<script type="text/javascript" src="http://quotesondesign.com/api/api-2.0.js"></script>

This is somewhat of a behind the scenes look at how I create and distribute the screencast. I go over the hardware and software I use, how it gets stiched together, and the sizes/formats it gets put into and why. Then I talk a little bit about the distribution and how it gets out there to you all.