从 API 获取 Twitter 卡片

编程入门 行业动态 更新时间:2024-10-25 03:32:59
本文介绍了从 API 获取 Twitter 卡片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我将能够检索存储在 Twitter Card 中的 HTML 标记 (https://dev.twitter/docs/卡片).

I would be able to retrieve HTML markup of what is stored in Twitter Card (https://dev.twitter/docs/cards).

到目前为止,我使用 TweetSharp 库从某个用户的时间轴中检索推文.但是,这并不奇怪,因为卡片是新事物,因此不包括在内.

Up until now I used TweetSharp library to retrieve tweets from some user's timeline. But, what is not surprising, because cards are new thing, it is not included.

有谁知道,是否可以通过 API 访问卡片(Twitter 爬虫缓存的数据)?

Does anyone know, if it is possible to access card (data cached by Twitter crawler) with API?

推荐答案

Twitter 卡片本身不会通过 Twitter API 公开.

The Twitter cards themselves are not exposed through the Twitter API.

您需要做的是向提到的 URL 发出请求并检查 <head> 元素以查看其中是否包含 Twitter Card 信息.

What you'll need to do is make a request to the URL mentioned and examine the <head> element to see if they have the Twitter Card info in there.

这篇关于从 API 获取 Twitter 卡片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-29 16:01:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1192083.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:卡片   API   Twitter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!