【问题标题】:Unwrap t.co links with R用 R 解开 t.co 链接
【发布时间】:2015-09-26 13:37:56
【问题描述】:

我希望使用 R 解开 t.co(Twitter 的缩短 URL)链接。

这是一个例子:http://t.co/Xvb6T3KyHr

这是解包后的 URL:http://www.donorschoose.org/project/we-need-technology-in-physical-education/1684466/?utm_source=dc&utm_medium=project&utm_campaign=twitter&rf=twitter-siteshare-2015-09-project-teacher_3103521

PythonJS 有答案,但据我所知,R 没有答案。

【问题讨论】:

  • twitteR::decode_short_url("http://t.co/Xvb6T3KyHr")? httr::HEAD("http://t.co/Xvb6T3KyHr")$url?
  • 成功了,谢谢。

标签: r twitter


【解决方案1】:

你可以试试

twitteR::decode_short_url("http://t.co/Xvb6T3KyHr") 

httr::HEAD("http://t.co/Xvb6T3KyHr")$url

还有一个来自@hrbrmstr 的名为longurl 的包。但是,它似乎不再适用于 t.co 链接。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-08
    • 1970-01-01
    • 2011-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-04
    • 1970-01-01
    相关资源
    最近更新 更多