Copy codeThe Code is as follows:
Var main = document. getElementById ("main ");
Var singlepost = false;
Var firstpost;
Var anchor;
For (var I = 0; I <main. childNodes. length; I ++)
{
If (main. childNodes [I]. className & main. childNodes [I]. className = "post ")
{
Var post = main. childNodes [I];
If (! Firstpost)
{
Firstpost = post;
}
For (var j = 0; j <post. childNodes. length; j ++)
{
If (post. childNodes [j]. className & post. childNodes [j]. className = "posthead ")
{
Var posthead = post. childNodes [j];
If (posthead. childNodes [1] & posthead. childNodes [1]. tagName & posthead. childNodes [1]. tagName = "H2 ")
{
If (posthead. childNodes [1]. childNodes [1] & posthead. childNodes [1]. childNodes [1]. tagName & posthead. childNodes [1]. childNodes [1]. tagName = "")
{
Anchor = posthead. childNodes [1]. childNodes [1];
}
Else
{
Anchor = posthead. childNodes [1]. childNodes [0];
}
}
Else
{
Anchor = posthead. childNodes [0]. childNodes [0];
}
Anchor. style. fontSize = "14pt ";
If (anchor. className & anchor. className = "singleposttitle ")
{
Singlepost = true;
}
}
}
}
}
If (singlepost)
{
Var postfoot = document. createElement ("div ");
Firstpost. appendChild (postfoot );
Postfoot. className = "postfoot ";
Postfoot. innerHTML = "<a href = \" http://del.icio.us/post? V = 4 & url = "+ encodeURIComponent (location. href) + "& title =" + encodeURIComponent (document. title) + "\"> <span> Add to del. icio. us </span> </a> ";
Postfoot. innerHTML + = "<a href = \" http://digg.com/submit? Phase = 2 & url = "+ encodeURIComponent (location. href) + "& title =" + encodeURIComponent (document. title) + "\"> <span> Digg This! </Span> </a> ";
Postfoot. innerHTML + = "<a href = \" http://www.facebook.com/share.php? U = "+ encodeURIComponent (location. href) + "\"> <span> Share on Facebook </span> </a> ";
Postfoot. innerHTML + = "<a href = \" http://www.google.com/bookmarks/mark? Op = edit & bkmk = "+ encodeURIComponent (location. href) + "& title =" + encodeURIComponent (document. title) + "\"> <span> Google Bookmark This </span> </a> ";
}