【问题标题】:Is there any way to post an <a> within tweet or post a link with text displayed instead of url?有没有办法在推文中发布 <a> 或发布带有显示文本而不是 url 的链接?
【发布时间】:2019-10-02 10:39:47
【问题描述】:

我正在使用 https://github.com/thujohn/twitter 从我的 CMS 发推文。

我想在该推文中添加一个链接。我可以简单地将 url 作为文本传递,它将自动处理,但是如何添加 url 但显示文本将是“阅读更多”或“单击此处”或类似的东西?

这是我当前的代码 -

Twitter::postTweet(['status' => 'Sample title - http://www.example.com/']);

http://www.example.com/ 应显示为 阅读更多,但链接将相同。

【问题讨论】:

    标签: php laravel twitter


    【解决方案1】:

    你不能。 Twitter 不允许您为与 URL 不匹配的链接指定链接文本。 (通过 API 或其他方式)。

    【讨论】:

    • 好的。所以,我必须将 url 仅作为文本传递,它会自动转换。
    猜你喜欢
    • 1970-01-01
    • 2018-04-09
    • 2011-03-12
    • 2014-07-20
    • 2013-02-13
    • 1970-01-01
    • 1970-01-01
    • 2012-07-18
    • 1970-01-01
    相关资源
    最近更新 更多