X Tutup
Skip to content

Commit 479b837

Browse files
committed
adds documentation re: changes to tweet character counting.
This is basically just a distillation of what is on twitter documentation, but consdensed so it is easier to read/reference when building out the changes.
1 parent d3eb170 commit 479b837

File tree

2 files changed

+81
-2
lines changed

2 files changed

+81
-2
lines changed

doc/changes_to_tweet_counting.rst

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
REST API Changes
2+
=================
3+
4+
Information compiled on Sept 14, 2016.
5+
6+
``statuses/update`` Endpoint
7+
----------------------------
8+
9+
``auto_populate_reply_metadata``
10+
+++++++++++++++++++++++++++++++
11+
12+
* Default is ``false``
13+
14+
* Must have ``in_reply_to_status_id`` set.
15+
16+
* Unknown what happens if not set. Probably error (does it get posted?)
17+
18+
* If the status to which you're replying is deleted, tweet will fail to post.
19+
20+
``exclude_reply_user_ids``
21+
++++++++++++++++++++++++++
22+
23+
* List of ``user_ids`` to remove from result of ``auto_populate_reply_metadata``.
24+
25+
* Doesn't apply to the first ``user_id``.
26+
27+
* If you try to remove it, this will be silently ignored by Twitter.
28+
29+
``attachment_url``
30+
++++++++++++++++++
31+
32+
* Must be a status permalnk or a DM deep link.
33+
34+
* If it's anything else and included in this parameter, Twitter will return an error.
35+
36+
37+
Most Other Endpoints
38+
--------------------
39+
40+
``tweet_mode``
41+
++++++++++++++
42+
43+
* Any endpoint that returns a tweet will accept this param.
44+
45+
* Must be in ``['compat', 'extended']``
46+
47+
* If ``tweet_mode == 'compat'``, then no ``extended_tweet`` node in the json returned.
48+
49+
* If ``tweet_mode == 'extended'``, then you'll get the ``extended_tweet`` node.
50+
51+
52+
Errors
53+
------
54+
* 44 -> URL passed to attachment_url is invalid
55+
56+
* 385 -> Replied to deleted tweet or tweet not visible to you
57+
58+
* 386 -> Too many attachments types (ie a GIF + quote tweet)
59+
60+
61+
Streaming API
62+
=============
63+
64+
Everything is going to be compatibility mode for now; however **all** tweets with have an ``extended_tweet`` node, which will contain the new information. According to Twitter's documentation though, there's the possibility that this node may not exist. We should be careful about making assumptions here.
65+
66+
67+
Changes to Models
68+
=================
69+
70+
Classic tweet: tweet with length < 140 char.
71+
Extended tweet: tweet with extended entities and text > 140 chars.
72+
73+
Twitter doesn't say if extended tweet with a total length of < 140 characters will be considered a "Classic tweet". They also state that an extended tweet shall have "text content [that] exceeds 140 characters in length", however this is contradictory to earlier statements about total text length retaining a hard max at 140 characters.
74+
75+
There will be two rendering modes: Compatibility and Extended. If in compatibility mode and tweet is "classic", no changes to tweet JSON. If in Extended mode, the following will change:
76+
77+
* ``text`` -> truncated version of the extended tweet's text + "..." + permalink to tweet. (Twitter is mute on whether an extended tweet's with (text + @mentions + urls) < 140 characters will have the @mentions + urls put back in ``text`` field.)
78+
79+
* ``truncated`` -> gets set to ``True`` if extended tweet is rendered in compat mode.

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
# built documents.
5858
#
5959
# The short X.Y version.
60-
version = '3.1'
60+
version = '3.2rc1'
6161
# The full version, including alpha/beta/rc tags.
62-
release = '3.1'
62+
release = '3.2rc1'
6363

6464
# The language for content autogenerated by Sphinx. Refer to documentation
6565
# for a list of supported languages.

0 commit comments

Comments
 (0)
X Tutup