Just in Chronicles

Life as a Voyage

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.

retweet link

See? I did it!

Well, it’s time to bed. Long weekend. Get tired.

Advertisements

Written by Justin Yoo

17/05/2009 at 14:26

One Response

Subscribe to comments with RSS.

  1. ์š”์ฆ˜ ์ œ๊ฐ€ ์ •๋ง ์ฆ๊ฒจํ•˜๋Š”๊ฒŒ ์žˆ๋Š”๋ฐ์š” ๋ฐ”๋กœ ํŠธ์œ„ํ„ฐ์ž…๋‹ˆ๋‹ค ์˜ˆ์ „ ํ”Œ๋ ˆ์ดํ†ก์„ ์ž ๊น ํ•ด๋ณธ ๊ฒฝํ—˜์œผ๋กœ ๋งˆ์ดํฌ๋กœ ๋ธ”๋กœ๊ทธ๋Š” ์ œ ์ฒด์งˆ์ด ์•„๋‹๋‹ค๋ผ๊ณ  ์ƒ๊ฐ์„ ํ–ˆ๊ธฐ์— ํŠธ์œ„ํ„ฐ๋ฅผ ์ด๋•Œ๊นŒ์ง€ ํ•  ์ƒ๊ฐ์ด ๋ณ„๋กœ ์—†์—ˆ๋Š”๋ฐ, ์šฐ์—ฐ์ฐฎ๊ฒŒ ์‹œ์ž‘ํ–ˆ๋‹ค๊ฐ€ ์ง€๊ธˆ์€ ์ •๋ง ์ฆ๊ธฐ๋Š” ์„œ๋น„์Šค๊ฐ€ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค ๋ณธ ๋ธ”๋กœ๊ทธ์—๋Š” ํฌ์ŠคํŠธ ํ•˜๋‹จ์— ๋ถ๋งˆํฌ ๋ชจ์Œ ๋ฒ„ํŠผ์ด ์žˆ์Šต๋‹ˆ๋‹ค ๊ฐœ์ธ์ ์œผ๋กœ ๋ธ”๋กœ๊ทธ์— ์ด๊ฒƒ ์ €๊ฒƒ ๋•์ง€ ๋•์ง€ ์„ค์น˜ํ•˜๋Š”๊ฒŒ ์‹ซ์–ด์„œ ๋ถ๋งˆํฌ ๋ชจ์Œ ๋ฒ„ํŠผ์„ ์„ค์น˜ํ•ด ๋†“์•˜๋Š”๋ฐ์š” ๋ถ๋งˆํฌ ๋ชจ์Œ ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ๊ตญ๋‚ด์— ์‚ฌ์šฉ๋˜๋Š” ์›ฌ๋งŒํ•œ ๋ถ..

    paperinz.com

    22/05/2009 at 02:30


Comments are closed.