如何使用 Python 解开 t.co 链接? [英] How can I unwrap t.co links with Python?

查看:27
本文介绍了如何使用 Python 解开 t.co 链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 t.co 短链接扩展为完整 URL.我该怎么做?

I want to expand t.co short links into a full URL. How can I do that?

推荐答案

您应该能够使用 Twitter 的 API.每条推文都有一个JSON表示;从 Python 读取 JSON 很简单.

You should be able to use Twitter's API. Each tweet has a JSON representation; reading JSON from Python is straightforward.

JSON 中包含的 实体之一expanded_url,定义为完全解析的 URL".

One of the entities contained in the JSON is expanded_url, defined as "The fully resolved URL".

这篇关于如何使用 Python 解开 t.co 链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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