snarfed / granary

đź’¬ The social web translator
https://granary.io
Creative Commons Zero v1.0 Universal
440 stars 57 forks source link

handle quote tweets #49

Closed snarfed closed 8 years ago

snarfed commented 8 years ago

granary currently renders quote tweets with just the quoted tweet URL, which isn't great. e.g. [this tweet]():

screen shot 2015-10-26 at 10 16 06 am

is rendered as:

Python everywhere! twitter.com/obrizan/status…

i'm not sure how we should render them, but ideally we'd fully render the quoted tweet's text, mentions, links, etc.

quote tweets can be identified by the quoted_status_id field.

very lightly related to snarfed/bridgy#504.

snarfed commented 8 years ago

woo, this should actually be pretty easy. evidently the whole quoted tweet object is included in the quoted_status field.

twitter renders it in an h-cite/reply context style box below the actual tweet, and hides the quote tweet link if it's at the end of the tweet text. we could just do the same.

kylewm commented 8 years ago

This is done already isn't it? e.g.,


<!DOCTYPE html>
<html>
<head><meta charset="utf-8"></head>
<body>
<article class="h-entry h-as-note">
  <span class="p-uid">tag:twitter.com:688090950829215744</span>
  <time class="dt-published" datetime="2016-01-15T20:10:41+00:00">2016-01-15T20:10:41+00:00</time>
  <span class="p-author h-card">
    <a class="p-name u-url" href="https://twitter.com/Eldritchreality">A powerful cabbit</a>
    <img class="u-photo" src="https://twitter.com/Eldritchreality/profile_image?size=original" alt="" />
  </span>
  <a class="u-url" href="https://twitter.com/Eldritchreality/status/688090950829215744">https://twitter.com/Eldritchreality/status/688090950829215744</a>
  <div class="e-content p-name">  
  YOU LITERALLY ARE A MARKOV CHAIN, WTF?<br />
<a href="https://twitter.com/eldritch_ebooks/status/688073162672713728">twitter.com/eldritch_ebook…</a>
<p>
<a class="link" href="https://twitter.com/eldritch_ebooks/status/688073162672713728">
</a>
</p>
  </div>

<article class="h-cite h-as-note">
  <span class="p-uid">tag:twitter.com:688073162672713728</span>
  <time class="dt-published" datetime="2016-01-15T19:00:00+00:00">2016-01-15T19:00:00+00:00</time>
  <span class="p-author h-card">
    <a class="p-name u-url" href="https://twitter.com/eldritch_ebooks">eldritch_ebooks</a>
    <img class="u-photo" src="https://twitter.com/eldritch_ebooks/profile_image?size=original" alt="" />
  </span>
  <a class="u-url" href="https://twitter.com/eldritch_ebooks/status/688073162672713728">https://twitter.com/eldritch_ebooks/status/688073162672713728</a>
  <div class="e-content p-name">
  I just discovered that Markov chains were just a random walk with delusions of grandeur.
  </div>
</article>
</article>
</body>
</html>
snarfed commented 8 years ago

awesome, yes! then we just need to do atom and we can close this.