特定推文的 Twitter 链接的 URL [英] URL for a link to Twitter for a specific tweet

查看:63
本文介绍了特定推文的 Twitter 链接的 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些使用 Twitter API 来获取推文的 Javascript.我解析数据并使用 jQuery 为 DOM 生成 HTML.

I have some Javascript that uses Twitter API to get tweets. I parse the data and use jQuery to generate HTML for the DOM.

我想要显示的一个方面是查看这条推文"链接——是的,听起来有点傻,但它允许用户获取特定推文的 URL.

An aspect of what I want to display is a "View this tweet" link -- yeah, sorta sounds silly, but it allows a user to get a URL for a specific tweet.

我正在生成一个带有 href 的标签.URL 格式如下:

I am generating an a tag with an href. The URL is of the form:

http://twitter.com/{twitter-user-id}/status/{tweet-status-id}

其中大括号中的内容是从推文中提取的实际数据(不,我不包括大括号).例如:

where the content in curly braces is actual data extracted from the tweet (no, I am not including the curly braces). For example:

http://twitter.com/Atechtrader/status/57432099984130050

在操作中发生的情况是,这适用于某些推文,但不适用于其他推文.对于失败的那些,Twitter 服务器会以内容表示请求的页面不存在进行响应.

What happens in operation is that this works for some tweets, but not others. For the ones that fails, the Twitter server responds with content that says the requested page does not exist.

我做错了什么吗?

推荐答案

https://twitter.com/statuses/ID 应该可以工作.
它将重定向到所需的状态.

https://twitter.com/statuses/ID should work.
it will redirect to the needed status.

这篇关于特定推文的 Twitter 链接的 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆