Page MenuHomeDevCentral

Compute Twitter text of status update length with t.co link wrapping
ClosedPublic

Authored by dereckson on Jan 13 2017, 09:57.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 12:43
Unknown Object (File)
Mon, Nov 18, 21:09
Unknown Object (File)
Wed, Nov 13, 12:56
Unknown Object (File)
Tue, Nov 12, 18:23
Unknown Object (File)
Tue, Nov 12, 13:26
Unknown Object (File)
Sat, Nov 9, 22:57
Unknown Object (File)
Thu, Oct 31, 11:41
Unknown Object (File)
Oct 22 2024, 12:22
Subscribers
None

Details

Summary

Twitter replaces links by t.co links.

As such, links are currently counted as 23 characters.
This link size is dynamic and we fetch it from configuraiton

New commands:
'.twitter reconfigure' refreshes the link size

New behavior:
Commands like !pub !idée counts links size correctly

New registry variables:

  • twitter.short_url_length: the cached link length
  • twitter.default_account: the account used for /help/configuration API calls

Reference:

Test Plan

Unit tests have been added for the URL links count.

.twitter reconfigure has been tested on Dæghrefn:

.tcl registry set twitter.short_url_length 1000
Tcl:
.tcl twitter_get_short_url_length
Tcl: 1000
.twitter reconfigure
[09:49:16] #Dereckson# twitter reconfigure
.tcl twitter_get_short_url_length
Tcl: 23

Diff Detail

Repository
rVIPER ViperServ scripts
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson added inline comments.
Daeghrefn/Communication.tcl
402

tweet

dereckson marked an inline comment as done.
dereckson edited edge metadata.

Fix typo in code comment

Add !StyleEncyclo command

The account https://twitter.com/StyleEncyclo provides a best of articles
where the style doesn't follow the Wikipedia conventions.

The account is managed by Ælfgar.
@Raminagrobis suggested to allow to publish from IRC like !idée.

This revision is now accepted and ready to land.Jan 13 2017, 11:02
This revision was automatically updated to reflect the committed changes.

Another test, post merge

150 characters status update
06:11:28 < Dereckson> !idée RFC 5785 via http://www.bortzmeyer.org/5785.html et
                      https://hueniverse.com/2009/11/23/host-meta-aka-site-meta-and-well-known-uris/ (auteur de la RFC)

Works like a charm at https://twitter.com/Ideedarticles/status/820876106916130816