Skip to content

Twitter and Creative Commons Code Don’t Validate!

August 21, 2007
tags:

Hello, and contrary to what you’ve probably been thinking, I am not dead.

After finishing my blog redesign (you can see it on the main page), I tried to validate it.

It scared me when it told me the Twitter badge code and the Creative Commons copyright code were both not valid!

I came up with some fixes for these, such as a valid Twitter badge code and valid Creative Commons code. Note: I strongly suggest against using the flash code. It’s ridiculously slow!

Here is the Twitter Valid Code:

<div id="twitter_div">
<h1>Twitter Updates</h1>
<ul id="twitter_update_list"><li></li></ul></div>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src=http://twitter.com/statuses/user_timeline/your-username-here.json?callback=twitterCallback2&amp;count=number-to-display"></script>

Now, you have ought to notice the bolded sections… namely the bolded sections of it such as your-username-here and number-to-display.

These spots are the parts that should be replaced! The your-username-here should be replaced with your username, and the number-to-display should be replaced with the number of updates you’d like to show, not going over 15 or below 1.

I hope you find this useful. If you don’t really know how to code very much but you just want the Twitter code, you can use it. It would be very smart if you actually retyped it in instead of copy-pasting.

My solution for the Creative Commons code is simple.

<p style="align:justify"><a rel="license" href="your-license-site-here">
<img align="left" alt="Creative Commons License" src="your-image-for-license-here" />
</a>
<b>your-blog-name-here</b> by
<i>your-name-here</i> is licensed under a
<a rel="license" href="your-license-site-here">your-license-name-here</a>.</p>

Let’s overview this code now.

your-license-name-here is your URL to the license page. For example, mine is http://creativecommons.org/licenses/by-nc-nd/3.0/us/.

your-image-for-license-here is the image that you chose; the place where it is. For example, mine is http://i.creativecommons.org/l/by-nc-nd/3.0/us/88×31.png.

your-blog-name-here is your blog name. For example, mine is chaotic mortal.

your-name-here is the author of the stuff you are trying to copyright. For example, mine is Brad.

your-license-name-here is your stuff that the readers will see. You can edit this so it works out for you. For example, mine is Commons Attribution Noncommercial No-Derivative Works 3.0 United States License.

Then you are finished! These sections of code should be valid now! At least they work on mine…

Advertisements
2 Comments leave one →
  1. May 14, 2008 11:02 pm

    Thank you so much for the Twitter code! I hate putting out what I claim to be solid work only to find the page doesn’t validate :S Speaking of which, there were three minor things that stood in my way to validation after copy/paste the code (probably the reason you suggested folks retype the code vs. copy/paste):

    1. Most of the quotes pasted as “smart” quotes … some did not however
    2. There’s a quote missing before the http in the second script call
    3. May want to hex the ampersand in the second script call

    At any rate, hope that wasn’t too nitpicky, because I sincerely appreciate the help 😀

    Thanks again!

  2. June 12, 2008 11:47 am

    No, I don’t think you are nitpicky, I think you are quite right. It is true that I always recommend users rewrite any code copied from websites for the reasons above. And I do admit that I wrote the code quite quickly and that there might be some things left out, so thank you for the insight.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: