MCPcopy Create free account
hub / github.com/Treeki/BirdBridge / tryExpandURL

Function tryExpandURL

conversion.ts:201–212  ·  view source on GitHub ↗
(tcoUrl: string, extendedEntities: any)

Source from the content-addressed store, hash-verified

199}
200
201function tryExpandURL(tcoUrl: string, extendedEntities: any): string {
202 // search through the url entities in a tweet to try and turn a t.co url into a full url
203 if (extendedEntities?.urls) {
204 for (const entity of extendedEntities.urls) {
205 if (entity.url === tcoUrl)
206 return entity.expanded_url;
207 }
208 }
209
210 // no luck
211 return tcoUrl;
212}
213
214export function convertCard(card: Record<string, any>, extendedEntities: any): Record<string, any> {
215 const pollMatch = card.name.match(/^poll(\d+)choice/);

Callers 1

convertCardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected