Update html_for_tweet to support extended tweets #429

Merged
ping merged 1 commit from extended-tweet into master 2016-09-23 06:19:35 -07:00
ping commented 2016-09-20 02:51:08 -07:00 (Migrated from github.com)

Based on the documentation at https://dev.twitter.com/overview/api/upcoming-changes-to-tweets I've added support to Twython.html_for_tweet to support extended tweets (both in compat and extended modes).

A couple of notes on my interpretation of the docs,

  1. the prefix and suffix regions should not be rendered as part of the display text region. Docs indicate that these "must instead be rendered as metadata" and there is an example of how replies (in prefix) can be rendered.

  2. New css classes twython-tweet-prefix and twython-tweet-suffix denote their respective regions and will allow devs to style or hide these regions where required.

I've created some demos (from the sample JSON payloads in twitterdev/tweet-updates + custom css) to demonstrate how the extended tweets can look like.

http://codepen.io/anon/pen/vXyBLW?editors=1000

screencap 2

Based on the documentation at https://dev.twitter.com/overview/api/upcoming-changes-to-tweets I've added support to Twython.html_for_tweet to support extended tweets (both in compat and extended modes). A couple of notes on my interpretation of the docs, 1. the prefix and suffix regions should not be rendered as part of the display text region. Docs indicate that these "must instead be rendered as metadata" and there is an example of how replies (in prefix) can be rendered. ![](https://g.twimg.com/dev/documentation/image/image01_0.png) 2. New css classes `twython-tweet-prefix` and `twython-tweet-suffix` denote their respective regions and will allow devs to style or hide these regions where required. I've created some demos (from the sample JSON payloads in [twitterdev/tweet-updates](/twitterdev/tweet-updates) + custom css) to demonstrate how the extended tweets can look like. http://codepen.io/anon/pen/vXyBLW?editors=1000 ![screencap 2](https://cloud.githubusercontent.com/assets/104607/18665356/6eb2efce-7f59-11e6-94fe-97b2d12749f4.png)
coveralls commented 2016-09-20 02:53:16 -07:00 (Migrated from github.com)

Coverage Status

Coverage increased (+0.5%) to 56.585% when pulling c57c4bfc34 on ping:extended-tweet into 975095d8d2 on ryanmcgrath:master.

[![Coverage Status](https://coveralls.io/builds/7964203/badge)](https://coveralls.io/builds/7964203) Coverage increased (+0.5%) to 56.585% when pulling **c57c4bfc3488c0905de49dbcfdd06a121d55f4b8 on ping:extended-tweet** into **975095d8d20cb9966d0226b32a70b7a41cef2fb4 on ryanmcgrath:master**.
michaelhelmick commented 2016-09-20 07:04:28 -07:00 (Migrated from github.com)

Hm. I concur with the code changes. As far as how it's displayed, do you think this is a good solution?

@philgyford opinions?

I'm perfectly fine with the presentation.

Hm. I concur with the code changes. As far as how it's displayed, do you think this is a good solution? @philgyford opinions? I'm perfectly fine with the presentation.
philgyford commented 2016-09-20 07:39:15 -07:00 (Migrated from github.com)

I think it looks fine, well done @ping.

For something that seems so simple, tweets sure are getting complicated!

I think it looks fine, well done @ping. For something that seems so simple, tweets sure are getting complicated!
michaelhelmick (Migrated from github.com) approved these changes 2016-09-23 06:19:31 -07:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/twython#429
No description provided.