File: changes_to_tweet_counting.rst

package info (click to toggle)
python-twitter 3.3-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,044 kB
  • sloc: python: 6,244; makefile: 213
file content (79 lines) | stat: -rw-r--r-- 2,729 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
REST API Changes
=================

Information compiled on Sept 14, 2016.

``statuses/update`` Endpoint
----------------------------

``auto_populate_reply_metadata``
+++++++++++++++++++++++++++++++

* Default is ``false``

* Must have ``in_reply_to_status_id`` set.

* Unknown what happens if not set. Probably error (does it get posted?)

* If the status to which you're replying is deleted, tweet will fail to post.

``exclude_reply_user_ids``
++++++++++++++++++++++++++

* List of ``user_ids`` to remove from result of ``auto_populate_reply_metadata``.

* Doesn't apply to the first ``user_id``.

* If you try to remove it, this will be silently ignored by Twitter.

``attachment_url``
++++++++++++++++++

* Must be a status permalnk or a DM deep link.

* If it's anything else and included in this parameter, Twitter will return an error.


Most Other Endpoints
--------------------

``tweet_mode``
++++++++++++++

* Any endpoint that returns a tweet will accept this param.

* Must be in ``['compat', 'extended']``

* If ``tweet_mode == 'compat'``, then no ``extended_tweet`` node in the json returned.

* If ``tweet_mode == 'extended'``, then you'll get the ``extended_tweet`` node.


Errors
------
* 44 -> URL passed to attachment_url is invalid

* 385 -> Replied to deleted tweet or tweet not visible to you

* 386 -> Too many attachments types (ie a GIF + quote tweet)


Streaming API
=============

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.


Changes to Models
=================

Classic tweet: tweet with length < 140 char.
Extended tweet: tweet with extended entities and text > 140 chars.

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.

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:

* ``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.)

* ``truncated`` -> gets set to ``True`` if extended tweet is rendered in compat mode.