Tag Archives: javascript

twitter auto refresh

Google chrome - CTRL+SHIFT+J to open javascript console. Type the following line there...

function updateIT(){$('#new-tweets-bar,.new-tweets-bar').click();setTimeout(updateIT, 1000);}updateIT();

Update: Here is a small extension if you are on google chrome (or using Firefox with greasemonkey installed).

Update (2013-01-15): Playing with twitter is a cat and mouse game! Here is what works as of today:
window.setInterval(function(){$(".js-new-tweets-bar").click();},10000);

Update (2019-03-22) : To hide promoted tweets use this:

$("div[data-promoted=true]").hide();

Google Finance bookmarklet

I use Google Finance to track stock/fund portfolios. Many of these portfolios track some investment policies and I enter the actual trades in there too. But the portfolios keep showing the old (i.e. closed) positions in the table making it look cluttered. I checked on their product blog/forum and this seems to be requested by some people (and ignored). Here is a small bookmarklet which will do this. You will need to drag the link to your bookmarks bar (Tested only with google chrome). Next, when you are on the google portfolio page, just click on the bookmark and it will hide all the closed positions! Woohoo!

Drag this link to Bookmarks bar: GFinance: Hide Closed Positions

P.S. If there is interest, I can turn this into a google chrome extension (greasemonkey) so this gets done automatically when you go to google portfolios page.

Friendconnect recommendations module

I have been thinking about adding more "social" features to my song lyrics website. Have been looking at google friendconnect for some time and had added their initial friend-wall module. But that did not quite integrate well into the website.  There is an appeal to having people using whatever identity they have (google, yahoo, aol, openID), and use it to collaborate on other websites. The recommendations module works great on such listing websites. However I did not want to club all the recommendations into a single pool, instead I wanted to keep the recommendations for songs, movies and people separate from each other. The example code does not make this clear. This post just clarifies how to do that.

Step1: Go to Friendconnect and create the recommendations widget.

Step 2: In the generated code, change the view-params parameter for the google.friendconnect.container.renderOpenSocialGadget function to use a unique docId for each of your container. Use the same string in the aggregation gadget code and the recommendation button code.

You can see this in action on the lyricsindia.net pages where I have three different recommendations containers for songs, people and movies.

Fix maharashtratimes.com font problems on firefox

Maharshtratimes.com (or maharashtratimes.indiatimes.com) is a marathi news website using unicode fonts. But it does not display correctly on firefox browser. The problem is because of a single HTML div which uses justified font style. It displays correctly on IE (which is why it is not getting fixed) - this could be because of firefox's buggy implementation of "align: justify" or that IE simply ignores that style (likely).

Anyway, here is a javascript one liner that you can bookmark and once the page is loaded, click on it to fix your font problem.

Fix Ma. Ta. -- Drag this link to your bookmarks.

I tried to create a greasemonkey script to do this automatically, but it's not working for some reason...

Update: Apparently it *is* a mozilla/firefox bug open for 4+ years. See here and here.

Update2: Here is a greasemonkey script by Saravana Kumar to fix this issue. Caution: you might want to change the included domains carefully (it by default runs on all http and https sites!)

Update3: Here is my greasemonkey script specific for maharashtratimes. Enjoy!

Update4: (2009-02-16) The original site seems to have removed this style attribute now. So the above post is now only for posterity.