diff --git a/lib/XRay/Formats/Hackernews.php b/lib/XRay/Formats/Hackernews.php index a359aff..ac2aa71 100644 --- a/lib/XRay/Formats/Hackernews.php +++ b/lib/XRay/Formats/Hackernews.php @@ -75,6 +75,10 @@ class Hackernews extends Format { ]; } + if(isset($data['parent'])) { + $entry['in-reply-to'] = ['https://news.ycombinator.com/item?id='.$data['parent']]; + } + return [ 'data' => $entry, 'original' => $json diff --git a/tests/HackernewsTest.php b/tests/HackernewsTest.php index e414f92..2fbceb5 100644 --- a/tests/HackernewsTest.php +++ b/tests/HackernewsTest.php @@ -53,6 +53,7 @@ What projects or companies are you working on to combat filter bubbles, walled g $this->assertEquals('2017-06-08T20:23:20+00:00', $data['data']['published']); $this->assertEquals('aaronpk', $data['data']['author']['name']); $this->assertEquals('https://news.ycombinator.com/user?id=aaronpk', $data['data']['author']['url']); + $this->assertEquals('https://news.ycombinator.com/item?id=14516538', $data['data']['in-reply-to'][0]); $this->assertArrayNotHasKey('name', $data['data']); $this->assertEquals('I am a member of the W3C Social Web Working Group (https://www.w3.org/wiki/Socialwg), and have been organizing IndieWebCamp (https://indieweb.org/) conferences in this space for the last 7 years. We\'ve been making a lot of progress:

* https://www.w3.org/TR/webmention/ - cross-site commenting

* https://www.w3.org/TR/micropub/ - API for apps to create posts on various servers

* https://www.w3.org/TR/websub/ - realtime subscriptions to feeds

* More: https://indieweb.org/specs

We focus on making sure there are a plurality of implementations and approaches rather than trying to build a single software solution to solve everything.

Try commenting on my copy of this post on my website by sending me a webmention! https://aaronparecki.com/2017/06/08/9/indieweb

', $data['data']['content']['html']); $this->assertEquals('I am a member of the W3C Social Web Working Group (https://www.w3.org/wiki/Socialwg), and have been organizing IndieWebCamp (https://indieweb.org/) conferences in this space for the last 7 years. We\'ve been making a lot of progress: