WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#36197 closed defect (bug) (fixed)

Update Twitter oEmbed URL

Reported by: niallkennedy Owned by: ocean90
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: Embeds Keywords: has-patch
Focuses: Cc:

Description

Twitter moved its preferred oEmbed URL for single Tweets from api.twitter.com to publish.twitter.com.

Update the oEmbed provider array to point at the new preferred endpoint, matching autodiscovery behavior. The XML response format will be removed.

Example URL:
https://twitter.com/WordPress/status/690269689855942657

Attachments (3)

36197.diff (1.3 KB) - added by niallkennedy 3 years ago.
36197.2.diff (1.4 KB) - added by ocean90 3 years ago.
36197.3.diff (1.6 KB) - added by ocean90 3 years ago.

Download all attachments as: .zip

Change History (14)

@niallkennedy
3 years ago

#1 @niallkennedy
3 years ago

  • Keywords has-patch added

#2 @jorbin
3 years ago

  • Milestone changed from Awaiting Review to 4.5
  • Type changed from enhancement to defect (bug)

As twitter is deprecating the XML on May 1, I think this is a good fix to get in for 4.5

@ocean90
3 years ago

#3 @ocean90
3 years ago

  • Version trunk deleted

36197.2.diff adds support for moments, which are supported by the new endpoint, see https://dev.twitter.com/web/embedded-moments/oembed.

#4 @jorbin
3 years ago

  • Owner set to jorbin
  • Resolution set to fixed
  • Status changed from new to closed

In 36946:

Update Twitter oEmbed URL.

Twitter moved its preferred oEmbed URL for single Tweets from api.twitter.com to publish.twitter.com. They also are deprecating XML responses.

Props niallkennedy.
Fixes #36197.

#5 @jorbin
3 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#6 @jorbin
3 years ago

  • Owner changed from jorbin to ocean90
  • Status changed from reopened to assigned

@ocean90 Do you want to add the moments support? Is that not covered by the current autodiscovery?

#7 @ocean90
3 years ago

@jorbin Autodiscovery works only if the page includes the link tag, https://twitter.com/i/moments/650667182356082688 has none. A single tweet like https://twitter.com/sonicadvance1/status/706219050473549824 includes one though.

@niallkennedy Is this something which Twitter is planning to implement?

#8 @niallkennedy
3 years ago

We will return an oEmbed response from the same API URL for Moment and collection URLs today. We plan to add autodiscovery.

#9 @ocean90
3 years ago

Thanks @niallkennedy, I'm going to add support for the new URLs.

Autodiscovery doesn't work for these because wp_filter_oembed_result() filters the HTML data.

Last edited 3 years ago by ocean90 (previous) (diff)

@ocean90
3 years ago

#10 @ocean90
3 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 36954:

oEmbed: Extend the provider list to support moments and timelines from Twitter.

Fixes #36197.

#11 @DrewAPicture
3 years ago

In 37038:

Docs: Add Twitter timelines and moments to the table in the hook doc for the oembed_provders filter, introduced in [36954].

See #36197. See #35986.

Note: See TracTickets for help on using tickets.