Pages

Wednesday, June 6, 2012

8

Hack for my recent comments hack: don't show own comments

Maybe you don't want to show your own comments in recent comments? Here is quick and simple hack for my Son of the better recent comments gadget to make it not show own comments.

Edit the HTML/Javascript gadget. Change lines 93 and 115, which both look like this now:
var entry = json.feed.entry[i];
to:
var entry = json.feed.entry[i]; if(entry.author[0].name.$t=="PUT YOUR USERNAME HERE") continue;
Edit your username inside the quotation marks. Save the gadget. Your comments won't be displayed anymore in recent comments.
[Hide comments] - [Show comments]
Click on a single comment to hide/show its text

8 comments:

Blackswan said... [reply]

Help! Thks for directing me to this link but I can't find the lines you've mentioned in my blog: Shirley's Luxury Haven

Unknown said... [reply]

Hmm... can't seem to suppress my own comments. Can you clarify what my "USERNAME" is? I tried both "Laura @ hip pressure cooking" (which is my Blogger display name) and "lapsushumanus" (which is my blogger log-in name).

Neither seem to get the job done.

I apologize for taking so much of your very precious time in my latest MSPolitas hack spree!!

Ciao,

L

MS-potilas said... [reply]

@Laura @ hip pressure cooking
Hi,

that should be the display name, "Laura @ hip pressure cooking" in your case, the full line becoming:

var entry = json.feed.entry[i]; if(entry.author[0].name.$t=="Laura @ hip pressure cooking") continue;

hope you get it working :)

Unknown said... [reply]

@MS-potilas

Still no luck. Could the @ in the username be causing problems?

Do I need to have any other hacks in place (I think one of the other hacks needed a user profile hack to work).

Thanks,

L

MS-potilas said... [reply]

@Laura @ hip pressure cooking
Hi,
you need only the (son of the better) recent comment hack with this modification. It might be the @ sign that breaks it. You could try the following line instead:

var entry = json.feed.entry[i]; if(entry.author[0].uri.$t=="http://www.blogger.com/profile/09492675720895007928") continue;

(All in one line.) There http://www.blogger.com/profile/09492675720895007928 is your profile url.

Unknown said... [reply]

@MS-potilas

That is a better variable because the profile URL never changes, but anyone could change, their username without knowing they are breaking the script.

I tired making the @ go through with back-slashes, HTML character number &; - the script didn't like it.

I will try re-installing the script from scratch because now it doesn't even like the profile URL variable.

This is a very valuable hack,none-the-less. Especially for those, like me, who approve each comment manually and then reply all at once. So it's boring to just see ME listed in the recent comments if I reply to 7 new comments! Plus, I want the focus of this widget to be on what OTHER people think of my blog not what I think about my own blog. :O

Ciao and have a great Tuesday!!

L

Unknown said... [reply]

@Laura @ hip pressure cooking

I re-installed the script from scratch. Then replaced the string with this:

var entry = json.feed.entry[i]; if(entry.author[0].uri.$t=="http://www.blogger.com/profile/09492675720895007928") continue;

I saved after each replace. The first replacement nothing happened - expected.

The second replacement, the script stopped executing altogether- oops!

Going to try now with the usernames - because I was only replacing the string in ONE spot of the script before.

Will write back to let you know about my progress.

Ciao,

L

Unknown said... [reply]

@Laura @ hip pressure cooking

OK, I went back to do what I was SUPPOSED to do in the script - twice - and it didn't work.

Oh well... I think it's time for me to give up on this hack. Thank you SOOO much for your help, and it was very kind of you to provide a personlized variable for me to just copy and paste!

Ciao,

L

Post a Comment

Related Posts Plugin for WordPress, Blogger...
See the hack
for this dynamic
views icon: