From 452accf6bf39fe960eec0244339f57a7e7230f4e Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Mon, 19 Feb 2018 05:47:39 -0800 Subject: [PATCH] include `quotation-of` property for quoted tweets --- lib/XRay/Formats/Twitter.php | 1 + tests/TwitterTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/XRay/Formats/Twitter.php b/lib/XRay/Formats/Twitter.php index db2fd9c..7d1579b 100644 --- a/lib/XRay/Formats/Twitter.php +++ b/lib/XRay/Formats/Twitter.php @@ -175,6 +175,7 @@ class Twitter extends Format { } } $refs[$quoteOf] = $quotedEntry['data']; + $entry['quotation-of'] = $quoteOf; } if($author = self::_buildHCardFromTwitterProfile($tweet->user)) { diff --git a/tests/TwitterTest.php b/tests/TwitterTest.php index f892ad9..dcff8b7 100644 --- a/tests/TwitterTest.php +++ b/tests/TwitterTest.php @@ -169,6 +169,7 @@ class TwitterTest extends PHPUnit_Framework_TestCase { $this->assertEquals('entry', $data['data']['type']); $this->assertEquals('Quoted tweet with a #hashtag https://twitter.com/aaronpk/status/817414679131660288', $data['data']['content']['text']); + $this->assertEquals('https://twitter.com/aaronpk/status/817414679131660288', $data['data']['quotation-of']); $tweet = $data['data']['refs']['https://twitter.com/aaronpk/status/817414679131660288']; $this->assertEquals('Yeah that\'s me http://xkcd.com/1782/', $tweet['content']['text']); }