Twitter卡无法正常工作

时间:2017-01-09 10:56:40

标签: meta-tags

我在网站上推特的元标记:

<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="....">
<meta property="twitter:title" content=".....">
<meta property="twitter:description" content="test description">
<meta property="twitter:image" content="....">

我甚至尝试使用 twitter:image:url ,并允许在 robot.txt 中使用twitter机器人但直到现在都没有运气

5 个答案:

答案 0 :(得分:1)

我可以知道你在哪里测试推特卡是否正常工作? 您使用https://cards-dev.twitter.com/validator查看了吗?

此外,有时元标记的放置很重要,将它们放在头部区域的早期,但是在og(开放图形)元标记之后。

让我知道你在卡片验证器上得到的错误(如果有的话)。

答案 1 :(得分:0)

在元标记中使用name代替property,例如:

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="....">
<meta name="twitter:title" content=".....">
<meta name="twitter:description" content="test description">
<meta name="twitter:image" content="....">

答案 2 :(得分:0)

如果上述方法均无效,请尝试将twitter:image更改为twitter:image:src,并确保图片符合尺寸要求:

支持的最小尺寸

  • 摘要:144x144px
  • summary_large_image:300x157px

支持的最大尺寸

在这两种情况下,最大值为4096x4096px,最多为5MB。

答案 3 :(得分:0)

Twitter共享网址

<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:site" content="....">
<meta property="twitter:title" content=".....">
<meta property="twitter:description" content="test description">
<meta property="twitter:image" content="....">

Share Url : <a href="https://twitter.com/intent/tweet?url=your_url">SHARE</a>

仅在https上有效

答案 4 :(得分:0)

Twitter的卡验证器将为我返回def show(): # connect to database if exist or if doesnt exit create one conn= sqlite3.connect("Books_table.bd") #create cursors Cursor = conn.cursor() Cursor.execute("SELECT * , oid FROM books") records = Cursor.fetchall() Query_window = Toplevel() Query_window.title("Show Table ...") Frm = Frame(Query_window) Frm.pack() Table = ttk.Treeview(Frm , column = (1,2,3,4,5,6,7,8) , show = "headings" , height = 5 ) Table.pack() Table.heading(1 , text = "Book name") Table.heading(2 , text = "Book number") Table.heading(3 , text = "Book writer") Table.heading(4 , text = "Book subject") Table.heading(5 , text = "Quantity") Table.heading(6 , text = "Borrower") Table.heading(7 , text = "Return date") Table.heading(8 , text = "Availability") # insert values to the table for record in records: Table.insert("", "end" , value = record ) #Commit changes conn.commit() #close database conn.close() ,直到我将No meta tags found标头添加到服务器的响应中为止。

根据我的收集,Twitterbot甚至不会尝试解析页面,除非服务器响应它期望看到的Content-Type: text/html,在这种情况下为Content-Type

相关问题