【问题标题】:Twitter intent tweet adding forward slashTwitter意图推文添加正斜杠
【发布时间】:2013-02-25 23:22:31
【问题描述】:

我正在按照 API 指南发布推文:

http://twitter.com/intent/tweet?text=Don%27t+hide+your+incessant+curiosity%2E+Exclaim+it%2E+%23quote+http://itechthereforeiam.com+via+@mjbrender

但它总是在末尾附加一个“/”:

不要隐藏你不断的好奇心。惊呼它。 #引用 http://itechthereforeiam.com 通过@mjbrender/

我发现一些对话指向这个方向,但没有回答问题。

感谢您的帮助。

【问题讨论】:

    标签: html url twitter


    【解决方案1】:

    不知道你是否曾经让这个工作,但我将 via 语句移到“前面”,它去掉了斜线。

    例如:

    https://twitter.com/intent/tweet?via=UserName&url=http://MyURL.com&text=Share your Story and Win!&hashtags=myHashTag&
    

    我之前在末尾有 via 标签,它会产生斜线。使用此代码,via 仍然出现在消息的末尾,而不是消息的开头,只是没有尾部正斜杠。

    希望这会有所帮助!

    【讨论】:

    • 请注意,虽然这可能有效,但正如大卫在下面的回答中所解释的那样,url 仍然存在一些编码问题......至少应该对“:”进行编码。一些额外的编码信息:en.wikipedia.org/wiki/Query_string#URL_encoding
    【解决方案2】:

    这是因为您没有对 MyURL 进行 URL 编码。 试试这个:

    https://twitter.com/intent/tweet?text=Don%27t+hide+your+incessant+curiosity.+Exclaim+it.+%23quote+http%3A//itechthereforeiam.com+via+@mjbrender
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-14
      • 1970-01-01
      • 2017-05-12
      • 1970-01-01
      • 2018-06-29
      • 2012-01-12
      相关资源
      最近更新 更多