Added the Retweet Link
Whew~!!!
Because TextCube (TC) lacks its flexibility and extendibility (http://justinchronicles.net/4), I did do the "trial and error" method millions of times for whole weekend. In order to add some functionalities, using javascript is the only option for TC.
Well, it brings about critical deficiency for non-javascript (non-JS) users from whatever reasons not to allow them to browse easily, even though javascript (JS) features can provide rich and interactive way of browsing. Anyway, the fact that JS is the only option to add "Retweet" link made me more creative, such as thinking out of the box or inventing wheels, hehe.
The first thing I would want to implement was URL shortening. Due to the limitation of 140 characters on Twitter, using shortened URL is inevitable. There are heaps of URL shortening service providers such as tinyurl.com, bit.ly, is.gd, tr.im, ur.ly, and so on. Each service has its own strengths and weaknesses, so I chose the ur.ly API for my URL shortening purpose.
In order to get data from ur.ly, first of all, I tried to use TC-built-in AJAX functions because it might be the easiest way to enable it. However, javascript doesn’t allow cross-domain access, which drove me crazy, so I had to find another solution.
The second option was jQuery. jQuery provides a lot of functionalities which can minimise developers’ efforts. I knew AJAX in jQuery would not work because of the same reason using TC-built-in AJAX one. So, I had to use JSONP to get data. However, $.ajax, $.get(), and $.getJSON() won’t get data properly. There was data I could see, but browsers couldn’t parse it. So, I had to give up using jQuery, too.
Damn it! How could I make it work? I spent all weekend to figure this out. I reluctantly had to make another page that parses an HTML tag made by javascript codes. I’m looking after a web site belongs to one of my friends. Because of this, I could implement my own API page to create an HTML tag to display the Retweet link. That was my third, and the last, option.
See? I did it!
Well, it’s time to bed. Long weekend. Get tired.

요즘 제가 정말 즐겨하는게 있는데요 바로 트위터입니다 예전 플레이톡을 잠깐 해본 경험으로 마이크로 블로그는 제 체질이 아닐다라고 생각을 했기에 트위터를 이때까지 할 생각이 별로 없었는데, 우연찮게 시작했다가 지금은 정말 즐기는 서비스가 되었습니다 본 블로그에는 포스트 하단에 북마크 모음 버튼이 있습니다 개인적으로 블로그에 이것 저것 덕지 덕지 설치하는게 싫어서 북마크 모음 버튼을 설치해 놓았는데요 북마크 모음 버튼을 누르면 국내에 사용되는 웬만한 북..
paperinz.com
22/05/2009 at 02:30