如何将文本链接转换为Google API剥离的真实链接?

时间:2012-04-17 14:34:51

标签: javascript google-api feedparser

google.load("feeds", "1");

function OnLoad() {

    // Create a feed control
    var feedControl = new google.feeds.FeedControl();

    // Add 1 feeds.
    feedControl.addFeed("http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=SteveMartinToGo&count=2");

    // Draw it.
    feedControl.draw(document.getElementById("twitter_content"));

}

google.setOnLoadCallback(OnLoad);

我正在使用Google FeedControl API从RSS中呈现推文。

这可能不是呈现推文的最佳方式,但Twitter的REST API有一个速率限制,并且在被击中几次后超时,这非常令人讨厌。

这似乎非常可靠,它只是一个RSS提要解析器,除了谷歌API剥离链接并使它们成为纯文本。如果可能的话,我想将它们转换回链接。

1 个答案:

答案 0 :(得分:0)

我发现这非常有用,没有速率限制问题和推文看起来很好。

http://jsfiddle.net/derek/Vjxt2/