How to add Digg to Blogger - Explained.

Nov 28, 2008

Well last day I was trying to add Digg to blogger. I was experimenting on how to add a Digg button on my blog. The digg button should use the auto-generated link of blogger as the digg_url for digging and submitting it for the first time.

After experimenting with my Blog template I came across this way to do it.

Things you should require/know :-

  • A Digg Account (optional)
  • A Blogger Account
  • Basics of XML/HTML/CSS/Java Script
  • Ctrl+C / Ctrl+V :)


First login into your blogger account. Go to the Layout tab and click on Edit HTML.

If you want you can make a backup of your existing template by clicking on "Download full template" [ If your confident skip this step ]

Understanding the Blogger Template
The basic structure of template has various sections defined. At top there are some variables defined. Which can be changed to change the color layout etc of the Blog.
After the variables the CSS definitions are given. You can edit the different classes to change the blog to your taste.

Now in the body tag you will find all the sections and div defined. Complete blog lies in the outer-wrapper div. And in it you will have the header-wrapper then content-wrapper and lastly footer-wrapper. The content-wrapper will contain the main and the sidebar wrappers.

In them you will have <b:section> and <b:widget> tags defined. So this basic template tells all the widgets that are placed on your page and their position as per the wrappers.

Example code:

<div id='main-wrapper'>
<b:section class='main' id='main' showaddelement='no'>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
</b:section>
</div>
<div id='sidebar-wrapper'>
<b:section class='sidebar' id='sidebar' preferred='yes'>
<b:widget id='BlogArchive1' locked='false' title='Blog Archive' type='BlogArchive'/>
<b:widget id='HTML1' locked='false' title='' type='HTML'/>
<b:widget id='Label1' locked='false' title='Labels' type='Label'/>
</b:section>
</div>


Now the widget tag... i.e., <b:widgets>
This above basic template just gives you a method for understanding the layout, But to understand how to put the automated url Digg button you will have to understand the code in this widget. So go ahead and click the checkbox marked as "Expand Widget Templates". This will expand the <b:widgets> tags and show you how the widget is implemented in it.

Each widget when expanded will have many includables <b:includable>. Each of this includable will have an id.
Example code:

<b:includable id='flat' var='data'>
<ul>
<b:loop values='data:data' var='i'>
<li class='archivedate'>
<a expr:href='data:i.url'><data:i.name/></a> (<data:i.post-count/>)
</li>
</b:loop>
</ul>
</b:includable>
<b:includable id='menu' var='data'>
<select expr:id='data:widget.instanceId + &quot;_ArchiveMenu&quot;'>
<option value=''><data:title/></option>
<b:loop values='data:data' var='i'>
<option expr:value='data:i.url'><data:i.name/> (<data:i.post-count/>)</option>
</b:loop>
</select>
</b:includable>


So as seen in this code there are two includables. we are interested in the includables having the id as post i.e.,
<b:includable id='post' var='post'>

So then in this includable we need to add our digg code. This blogger template defines and provides access to its data object. For e.g., <data:post.url/> signifies the url of the Blog post. It is the permalink of each blog entry. The digg widget button provided by Digg needs the post url. So this will generate it automatically for us. Now the code that I have used on to show the digg button is pasted in the includable as shown. You can place it and style it as you like.

Basically you will need to copy from the Digg Box start comment to Dig Box End comment. Copy and paste it in your blog and enjoy the easy Digg Button.

<b:includable id='post' var='post'>
<div class='post hentry'>
<a expr:name='data:post.id'/>
<b:if cond='data:post.title'>
<h3 class='post-title entry-title'>
<b:if cond='data:post.link'>
<a expr:href='data:post.link'><data:post.title/></a>
<b:else/>
<b:if cond='data:post.url'>
<a expr:href='data:post.url'><data:post.title/></a>
<b:else/>
<data:post.title/>
</b:if>
</b:if>
</h3>
</b:if>
<!--- ==== Digg Box Code by J start ==== -->
<div class='diggBox' style='margin: 4px; float: right;'>
<script type='text/javascript'>
digg_url = &#39;<data:post.url/>&#39;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>
<!-- == Digg Box code end ===-->
<div class='post-header-line-1'/>

<div class='post-body entry-content'>
<data:post.body/>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>

</div>
</b:includable>
She broke up with Me !

Nov 24, 2008

So they say, every love comes to an end. Or does it?

I thought otherwise until it happened to me. Or did it?

Is it the end of the relationship? Or is it just a breakup and we will meet again. I hope we do.

We had a year long relationship. One Year and 7 days to be precise. Its the time when I came to this city in south. We had a really good time together for like 3-4 months then I kind of didn't pay that much attention, got busy with other stuff. But for the few weeks I had only my beautiful Elf in mind. The relationship was back strong. I was too happy with her for the few days. It was kind of a performance tweak. And then this huge blow, suddenly without even saying a good bye :(.

What happened? What went wrong?

Some might say that I cheated but thats not the thing. I paid equal attention to both of them, Gharwali and Baharwali. And I am sure they both knew that too. They had a great ActiveSync partnership working between them. I guess losing a baharwali is more difficult.

Well thats how they(my friends) say... my lappy T42 is my Gharwali for enjoying at home, and P3450 my Baharwali for outdoors. Yes, my HTC Touch P3450 codename Elf has left me, or I can say the Big Bastard world came between us.

So let me tell you the story, So that I dont have to tell it over and over again.

It happened today, the cloudy weather outside made a way into my life. I as usual woke up late and started for my office. On the way I found an auto and the guy asking 20 Rs extra on the metered fare. I argued and got it settled to 10 Rs. extra. Well everything was usual daily routine until now. When I got down at office, while taking out my wallet I kept the Elf on my bag beside me. Then there was this problem of change of 100Rs. I came out and asked a colleague who was passing by. He gave me the money I gave it to the Auto driver and took the bag and left. I pulled the bag from the handle without looking so he mobile dropped over there. I went upstairs and realised, started calling the number nobody picked it, then somebody started rejecting the call and then switched it off. Well I and you kinda knew this was going to happen.

Well rest you know what I had to do, called customer care barred outgoing calls. Went to customer care office got a duplicate SIM card. Went to police station with the IMEI number filed the complaint.

Now I seriously hope that the good guys of the Police Dept find her out. Otherwise, I am stuck here with a company provided Nokia 1100, Oh my god !!

Well for those who dont know HTC Touch product code name is ELF. If properly tweaked she runs like hell :). Wish the breakup gets over and we are back together. Hope you add a prayer for me.
Gun Powder

Aug 21, 2008

When I try to sleep
I wish I rather weep.
Wash away with tears,
My sorrows and fears.

Once the heart of Gold
is now so cold.
What glowed like fire.
smells like burnt tire.

With the passing tide
Am I more dead inside?
Is this it?
No, Somewhere in the ashes
Something is lit.

Only the fuse has burnt...
and left is the Gun Powder.
Happy Graduation Day

May 25, 2008

Some of you may have remembered and some forgotten.
That today is the fated day when we all graduated out of IITG. It's been one year guys.

Happy Graduation Day, The first anniversary.

So its time to enjoy :) or is it?

Today is the time when you can stand and look back at the year past and think
"kya khoya kya paya maine"

It's hard to believe it's been that long.

Time flies, I guess specially when you are in the real world, the challenges and learning, the life long process goes even faster when you are out of college and facing the real life. So much so that its here and you don't know, and you're amazed you wonder and think about the sweet memories of friends which were your family.

Many things have changed.

Some got promoted,
Some got new jobs,
Some starting ventures,
Some got married,
Some are getting married,
Some are happy and content,
Some are sad and frustrated,
Some climbing the stairs,
Some taking a slide down,
Some winning the game called life,
Some trying to win it,

Although its just one year,
But its a milestone,
And you will reach many milestones in this journey called life.
But always take out some time
-to say
-to wish
-to congratulate
-to share a loving shoulder
with the friends you made and will treasure your whole life.

Remember you are not alone. Friends are always there.
To all my dear friends - I wish to say that - "I Love You" :) . My life would be hell without you.

You may be physically with me or not. But I wish our paths get crossed many times even if we cant be together. I wish to write too much but you would probably thinking "aur kitna lamba hai". So will conclude.

I will conclude with saying that on all fronts, things are going not to well but not too bad too. And the anniversary of my graduation seems like a good moment to stop, and Thank God for everything.