Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twitter publish: truncating used too many chars #714

Closed
snarfed opened this issue Jan 3, 2017 · 5 comments · Fixed by snarfed/granary#99
Closed

twitter publish: truncating used too many chars #714

snarfed opened this issue Jan 3, 2017 · 5 comments · Fixed by snarfed/granary#99
Labels

Comments

@snarfed
Copy link
Owner

snarfed commented Jan 3, 2017

specifically for @davidmead's http://djm.click/blog/b/2yX . (sorry david!) redirects to http://davidjohnmead.com/blog/2017/01/02/10711/ . user page https://www.brid.gy/twitter/davidmead .

i suspect the code for handling twitter's new extended tweets. :( snarfed/granary#89 , https://dev.twitter.com/overview/api/upcoming-changes-to-tweets .

mf2:

{
 "items": [
  {
   "type": ["h-entry", "h-as-article"],
   "properties": {
    "name": [""],
    "url": [
     "http://davidjohnmead.com/blog/2017/01/02/10711/",
     "http://davidjohnmead.com/blog/2017/01/02/10711/"
    ],
    "content": [
     {
      "html": "\n    <p>Hi @manton2. Your <a href=\"http://micro.blog/about\" title=\"about page\">Micro.blog</a> project sounds interesting from an #IndieWeb <abbr title=\"point of view\">POV</abbr>, but I\u2019m still not getting what it is. Sounds like an RSS reader you comment on, and others see those comments too. I think I\u2019m missing something.<br/>\nin reply to:<br/>\n<a class=\"u-in-reply-to\" href=\"http://www.manton.org/2017/01/4622.html\"></a></p><a class=\"u-in-reply-to\" href=\"http://www.manton.org/2017/01/4622.html\">\n</a><blockquote class=\"wp-embedded-content\" data-secret=\"m5s35Ayigw\"><a class=\"u-in-reply-to\" href=\"http://www.manton.org/2017/01/4622.html\"></a><p><a class=\"u-in-reply-to\" href=\"http://www.manton.org/2017/01/4622.html\"></a><a href=\"http://www.manton.org/2017/01/4622.html\"></a></p></blockquote>\n<p><iframe class=\"wp-embedded-content\" data-secret=\"m5s35Ayigw\" frameborder=\"0\" height=\"338\" marginheight=\"0\" marginwidth=\"0\" sandbox=\"allow-scripts\" scrolling=\"no\" security=\"restricted\" src=\"http://www.manton.org/2017/01/4622.html/embed#?secret=m5s35Ayigw\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u201c\u201d \u2014 Manton Reece\" width=\"600\"></iframe></p>\n<a class=\"u-bridgy-ignore-formatting\" href=\"https://www.brid.gy/publish/twitter\"></a><span class=\"relsyn\"><ul>Syndicated to: <li><a class=\"u-syndication\" href=\"https://twitter.com/davidmead/status/816104769676836864\" rel=\"syndication\" title=\"Twitter\"><span class=\"syn-name\">Twitter</span><svg aria-hidden=\"true\" class=\"svg-icon svg-twitter\"><use xlink:href=\"http://davidjohnmead.com/blog/wp-content/plugins/syndication-links/includes/social-logos.svg#twitter\"></use><svg></svg></svg></a></li></ul></span>      ",
      "value": "\n    Hi @manton2. Your Micro.blog project sounds interesting from an #IndieWeb POV, but I\u2019m still not getting what it is. Sounds like an RSS reader you comment on, and others see those comments too. I think I\u2019m missing something.\nin reply to:\n\n\n\nSyndicated to: Twitter      "
     }
    ],
    "in-reply-to": [
     "http://www.manton.org/2017/01/4622.html",
     "http://www.manton.org/2017/01/4622.html",
     "http://www.manton.org/2017/01/4622.html",
     "http://www.manton.org/2017/01/4622.html"
    ],
    "bridgy-ignore-formatting": [
     "https://www.brid.gy/publish/twitter"
    ],
    "syndication": [
     "https://twitter.com/davidmead/status/816104769676836864"
    ],
    "..."
}
@snarfed snarfed added the publish label Jan 3, 2017
@snarfed
Copy link
Owner Author

snarfed commented Jan 3, 2017

communication around the extended tweets launch has been...unclear at best. :/ for char counting, the best conclusion so far seems to be that it's launched for trailing attachment URLs (pictures etc), but not yet for @-mentions: https://twittercommunity.com/t/mentions-in-replies-are-being-counted-towards-140-character-limit/76427/2

@snarfed
Copy link
Owner Author

snarfed commented Jan 4, 2017

log:

Converted to ActivityStreams object: {
  "updated": "2017-01-02T20:47:32+00:00",
  "url": "http://djm.click/blog/b/2yX",
  "content": "Hi @manton2. Your Micro.blog project sounds interesting from an #IndieWeb POV, but I’m still not getting what it is. Sounds like an RSS reader you comment on, and others see those comments too. I think I’m missing something.\nSyndicated to:",
  "published": "2017-01-02T20:47:32+00:00",
  "objectType": "note"
  ...
}
urlopen POST https://api.twitter.com/1.1/statuses/update.json?status=Hi+%40manton2.+Your+Micro.blog+project+sounds+interesting+from+an+%23IndieWeb+POV%2C+but+I%E2%80%99m+still+not+getting+what+it+is%E2%80%A6+http%3A%2F%2Fdjm.click%2Fblog%2Fb%2F2yX {}
Error 403, response body: {"errors":[{"code":..."message":"Status is over 140 characters."}]}
Twitter API error: {"errors":[{"code":..."message":"Status is over 140 characters."}]} HTTP Error 403: Forbidden
Traceback (most recent call last):
...
File "/base/data/home/apps/s~brid-gy/7.398192701546690431/local/lib/python2.7/site-packages/granary/twitter.py", line 542, in create
  ignore_formatting=ignore_formatting)
File "/base/data/home/apps/s~brid-gy/7.398192701546690431/local/lib/python2.7/site-packages/granary/twitter.py", line 746, in _create
  resp = self.urlopen(API_POST_TWEET, data=urllib.urlencode(data))
File "/base/data/home/apps/s~brid-gy/7.398192701546690431/local/lib/python2.7/site-packages/granary/twitter.py", line 943, in urlopen
  return request()
File "/base/data/home/apps/s~brid-gy/7.398192701546690431/local/lib/python2.7/site-packages/granary/twitter.py", line 922, in request
  url, self.access_token_key, self.access_token_secret, ...
...

@snarfed
Copy link
Owner Author

snarfed commented Jan 4, 2017

tweet text we sent to twitter below. 144 chars total, 116 text (including ellipsis) plus space plus URL.

Hi @manton2. Your Micro.blog project sounds interesting from an #IndieWeb POV, but I’m still not getting what it is… http://djm.click/blog/b/2yX

@kylewm
Copy link
Contributor

kylewm commented Jan 4, 2017

Sorry I think this is my fault, unrelated to Twitter's new extended stuff.

Twitter is linkifying Micro.blog, so it uses up 23 characters, but .blog isn't in brevity's list of TLDs yet

https://github.com/kylewm/brevity/blob/master/brevity.py#L11

@snarfed
Copy link
Owner Author

snarfed commented Jan 4, 2017

oh man, nice catch @kylewm! thank you!

snarfed pushed a commit to snarfed/granary that referenced this issue Mar 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants