正如标题读,我想是这样的:拉图像
如果鸣叫包含一个链接到的图像(yfrog)然后进行<img>
与SRC =“”那个链接。
我该怎么做?
- 更新 -
欧凯所以我想出来的,到目前为止是我应该做的功能由“回归this.replace”,就像克里斯Coyier做了与链接:
String.prototype.linkify = function() {
return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/, function(m) {
return m.link(m);
});
};
但我无法找到一种方法来为我的需要编写适当的功能。
同样,我想要的: 如果字符串包含一个单词(例如instagram),请选择整个“单词”(在本例中为http:// ...)并将其放入src =“”的<img>
标签。
- 更新2 -
http://dev.twitter.com/pages/tweet_entities
我有一种感觉,我可以利用这media_url
变量。我可以通过JSON实现它吗?我现在用它来获取推文的文本? $.getJSON('http://twitter.com/status/user_timeline/username.json?count=10&callback=?' ... {
到目前为止,你做了什么“尝试”? – Neal
我找不到办法做到这一点! –
@MattiasAlfborger检查这个答案 - http://stackoverflow.com/questions/9951538/retrieve-twitter-pictures-or-videos-when-using-an-specific-hashtag/10909027#10909027 – mvark