Link shortening: Bitly/Rebrandly integration #159

Open
opened 2026-06-23 13:35:41 +00:00 by jmiller · 0 comments
Owner

Summary

Shorten article URLs before cross-posting using Bitly, Rebrandly, or a built-in shortener. SocialBee, Buffer, and SNAP all offer this.

Implementation

Component Config

  • link_shortener: none / bitly / rebrandly / custom
  • bitly_api_token: API token
  • rebrandly_api_key: API key
  • custom_shortener_url: Custom API endpoint

Integration Points

  • CrossPostDispatcher::buildArticleMeta() -- shorten the URL before building placeholders
  • Cache shortened URLs per article to avoid re-shortening
  • New placeholder: {short_url} (shortened) alongside existing {url}

Bitly API

POST https://api-ssl.bitly.com/v4/shorten
{"long_url": "https://example.com/article"}

Rebrandly API

POST https://api.rebrandly.com/v1/links
{"destination": "https://example.com/article"}

Acceptance Criteria

  • Bitly integration with API token config
  • Rebrandly integration with API key config
  • {short_url} placeholder
  • Cache shortened URLs per article
  • Graceful fallback to full URL on API error
## Summary Shorten article URLs before cross-posting using Bitly, Rebrandly, or a built-in shortener. SocialBee, Buffer, and SNAP all offer this. ## Implementation ### Component Config - `link_shortener`: none / bitly / rebrandly / custom - `bitly_api_token`: API token - `rebrandly_api_key`: API key - `custom_shortener_url`: Custom API endpoint ### Integration Points - `CrossPostDispatcher::buildArticleMeta()` -- shorten the URL before building placeholders - Cache shortened URLs per article to avoid re-shortening - New placeholder: `{short_url}` (shortened) alongside existing `{url}` ### Bitly API ``` POST https://api-ssl.bitly.com/v4/shorten {"long_url": "https://example.com/article"} ``` ### Rebrandly API ``` POST https://api.rebrandly.com/v1/links {"destination": "https://example.com/article"} ``` ## Acceptance Criteria - [ ] Bitly integration with API token config - [ ] Rebrandly integration with API key config - [ ] `{short_url}` placeholder - [ ] Cache shortened URLs per article - [ ] Graceful fallback to full URL on API error
Sign in to join this conversation.
No labels
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteCross#159