Page MenuHomeDevCentral

Compute Twitter text of status update length with link wrapping

Authored by dereckson on Jan 13 2017, 09:57.



Twitter replaces links by 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


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 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

rVIPER ViperServ scripts
No Linters Available
No Unit Test Coverage
Build Status
Buildable 1270
Build 1518: arc lint + arc unit

Event Timeline

dereckson created this revision.Jan 13 2017, 09:57
dereckson planned changes to this revision.Jan 13 2017, 10:05
dereckson added inline comments.


dereckson updated this revision to Diff 2100.Jan 13 2017, 10:06
dereckson marked an inline comment as done.
dereckson edited edge metadata.

Fix typo in code comment

dereckson updated this revision to Diff 2101.Jan 13 2017, 10:59

Add !StyleEncyclo command

The account 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.

dereckson updated this revision to Diff 2102.Jan 13 2017, 11:02

Reverted to diff 2100.

dereckson accepted this revision.Jan 13 2017, 11:02
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 et
             (auteur de la RFC)

Works like a charm at