Getting Latest Posts from Blogger

I've done this in a few different ways, but I love the simplicity of the following example. I've included the whole page of code to show you what goes where. Be sure to change the blogID to match your own blog.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>

<
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<
head>
  <
meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

  <
title>Google Data API SampleLast Three Blog Posts</title>
  <
script src="http://www.google.com/jsapi" type="text/javascript"
charset="utf-8"></script>
  
<script type="text/javascript" charset="utf-8">
  
// Configuation - Edit these values to match your blog!
  
blogId "32786009";
  var 
entriesToRetrieve 3;

  
// Load Google Data library and set callback
  
google.load("gdata""1");
  
google.setOnLoadCallback(populatePosts);

  function 
populatePosts() {
    
// Create service object
    
var service = new
google.gdata.blogger.BloggerService("exampleCo-exampleApp-1.0");

    
// Retreive list of blogs
    
var feedUri "http://www.blogger.com/feeds/" blogId "/posts/default";
    
service.getBlogFeed(feedUriprocessFeedhandleError);
  
}

  
function handleError(errorMsg{
    
// Display an alert dialog with the error text
    
alert(errorMsg);
  
}

  
function processFeed(feedRoot{
    
var entries feedRoot.feed.getEntries();
    for (var 
0entries.length && entriesToRetrievei++) {
      
// Locate URI to blog post
      
var links entries[i].getLinks();
      var 
postLink null;
      for (var 
0links.length && !postLinkj++) {
        
if (links[j].getRel() == "alternate" && links[j].getType() ==
"text/html")
          
postLink links[j].getHref();
      
}

      
// Create hyperlink
      
var linkNode document.createElement("a");
      
linkNode.setAttribute("href"postLink);

      
// Create text
      
var textNode document.createElement("p");
      
textNode.appendChild(document.createTextNode(entries[i].getTitle().getText()
" (" formatDate(entries[i].getPublished().getValue().getDate()) +
")"));
      
linkNode.appendChild(textNode);

      
// Write to page
      
document.getElementById('post_container').appendChild(linkNode);
    
}
  }

  
function formatDate(date{
    
return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" +
date.getDay();
  
}

  </script>
</head>

<
body>

<
p>Blog posts:</p>

<
div id="post_container"></div>

</
body>
</
html
COMMENTS
(0) Comments

Simple Ajax Shopping Cart with PHP and Prototype

Jason Gilmore over at Developer.com shows us how to build a shopping cart using PHP, session handling, and the Prototype JavaScript library. The cart allows users to add and delete products from the cart, as well as change cart quantities. And of course, the interaction is seemingly instantaneous, allowing for the user to continue shopping without waiting for the page to reload. http://www.developer.com/lang/jscript/article.php/10939_3656001_2/Developing-a-Ajax-driven-Shopping-Cart-with-PHP-and-Prototype.
COMMENTS
(5) Comments

Turn any webform into a powerful wizard with jQuery (FormToWizard plugin)

This detailed tutorial will show you how to turn long webform into a wizard with "steps left" information. A plugin is also available for download. http://www.jankoatwarpspeed.com/post/2009/09/28/webform-wizard-jquery.aspx
COMMENTS
(0) Comments

Color Palate Browser

Adobe's got a new website dedicated to beautiful color palates. Browse thousands of harmonious combinations and submit your own. Really handy tool - sometimes the only thing you need to inspire a new design are the right colors. You can create your own palate with Kuler's seriously powerful and fun tool. You pick your base color and it extrapolates the 4 natural harmonies, all of which can be tweaked. You can also create your theme from a photograph, which is very useful - sample a color from your client's logo and see what you get. I'm wearing out this bookmark... http://kuler.adobe.com/
COMMENTS
(1) Comments

CSS Equal Column Height Problem

Many of you have encountered this at one time or another - you can't get your columns to dynamically resize themselves to match the tallest column in your "container" div. Here a couple good solutions to the problem.

Prototype
First off, here's a Prototype solution. Just be sure to change the 2nd and 3rd lines to match your div names.

function equalizePanels() {
var col = $('content-navigation-panel');
var 
tbx = $('content-right-toolbar');
if(
tbx && (Element.getHeight(col) < Element.getHeight(tbx))) {
col
.style.height Element.getHeight(tbx) + 'px';
else if(tbx && (Element.getHeight(col) > Element.getHeight(tbx))) {
tbx
.style.height Element.getHeight(col)-25 'px';
else {
var el = $('content');
col.style.height Element.getHeight(el) + 'px';
}


Second, here's a Javascript solution from Dynamic Drive:
http://www.dynamicdrive.com/style/blog/entry/css-equal-columns-height-script/
COMMENTS
(0) Comments

Preloading Images with CSS

I know, I know. It’s practically sacreligious to even suggest preloading images in any language other than Javascript, but a friend recently suggested this technique to me and after trying it out, I’m sold. The code is light, very straightforward, and more important - simple. I don’t know how many times I’ve written the Javascript code, but for some reason I always screw it up the first time and end up going back scratching my head for a few minutes before spotting the error. This is just elegant in comparison - you can’t screw up an HTML image. So without furrther ado…


The CSS
Create a class with display set to none and add it to your stylesheet:

<style type="text/css">
.
hiddenPic {display:none;}
</style


The HTML
Add image tags for your big images at the bottom of the page. I did this for big rollover images to achieve a smooth roll, but you can also preload the images for secondary pages at the bottom of your home page.

<img src="first_big_image.jpg"  alt="whatever" height="350" width="350" class="hiddenPic">
<
img src="second_big_image.jpg"  alt="whatever" height="350" width="350" class="hiddenPic">
<
img src="third_big_image.jpg"  alt="whatever" height="350" width="350" class="hiddenPic"


And that’s it. Voila. Love it.

COMMENTS
(0) Comments

Nice Ajax Photo Uploader

FancyUpload is a file-input replacement which features an unobtrusive, multiple-file selection menu and queued upload with an animated progress bar. It is easy to setup, is server independent, completely styleable via CSS and XHTML and uses MooTools to work in all modern browsers. http://digitarald.de/project/fancyupload/
COMMENTS
(0) Comments

40 CSS Web Form Style Tutorials

When developing a project it’s important to have a good css form input structure throughout, most commonly used css forms will tend to be Login, Register and user Profiles. If you have taken the time to develop a custom template for your project more often than not the default appearance of forms you have created are not ideally suited to you designs overall look and feel. Social CMS Buzz has gathered together a great list of tutorials that should have your new forms looking great or breath life into your existing form design. http://socialcmsbuzz.com/40-css-web-form-style-tutorials-for-web-developers-14082008/
COMMENTS
(1) Comments

Great CSS Table Gallery

Here are 98 unique CSS table designs. This is a terrific resource, one that I've been mining for a while now. A great showcase of what can be done with some creative stylesheets. http://icant.co.uk/csstablegallery/
COMMENTS
(0) Comments

Consist Typography with CSS

In this article by Richard Rutter, the author attempts to reconcile the designer’s requirement for accuracy with the user’s need to resize text on demand, arriving at a best practice that satisfies designers and users and works across browsers and platforms. Good basic practice. http://www.alistapart.com/articles/howtosizetextincss/
COMMENTS
(0) Comments

CSS Rollovers Using Sprites

Store all buttons/navigation items/whatever we wish in a single master image file, along with the associated “before” and “after” link states. Great technique and a very well done tutorial. http://www.alistapart.com/articles/sprites/
COMMENTS
(0) Comments

Thomas Doyle’s Miniature World

Check out the diaramas of Thomas Doyle, miniature vignettes at 1:43 scale. In the artist's words, the works "depict the remnants of things past—whether major, transformational experiences, or the quieter moments that resonate loudly throughout a life. In much the way the mind recalls events through the fog of time, the works distort reality through a warped and dreamlike lens." His work is so small and personal in nature, that to observe it from above - through glass - gives a voyeuristic, almost omnipotent feeling. Check it out. http://www.thomasdoyle.net/
COMMENTS
(0) Comments

Top 7 PHP Security Blunders

PHP is a terrific language for the rapid development of dynamic Websites. It also has many features that are friendly to beginning programmers, such as the fact that it doesn't require variable declarations. However, many of these features can lead a programmer inadvertently to allow security holes to creep into a Web application. The popular security mailing lists teem with notes of flaws identified in PHP applications, but PHP can be as secure as any other language once you understand the basic types of flaws PHP applications tend to exhibit. http://www.sitepoint.com/article/php-security-blunders/
COMMENTS
(0) Comments

Using Cookies and PHP to Track Site Visits

Cookies were invented to allow webmaster's to store information about the user and their visit on the user's computer. At first they were feared by the general public because it was believed they were a serious privacy risk. Nowadays nearly everyone has cookies enabled on their browser, partly because there are worse things to worry about and partly because all of the "trustworthy" websites now use cookies. This lesson will teach you the basics of storing a cookie and retrieving a cookie, as well as explaining the various options you can set with your cookie. http://www.tizag.com/phpT/phpcookies.php
COMMENTS
(0) Comments

PHP Session Basics

This is very basic, but provides a good introduction to sessions. If your website has matured a bit, and you think you'd like to pass variables from page to page either for a shopping cart or a personalized visit, then you're probably thinking about sessions. http://www.tizag.com/phpT/phpsessions.php
COMMENTS
(194) Comments
Page 1 of 2 pages  1 2 >