> For the complete documentation index, see [llms.txt](https://louiss-organization-10.gitbook.io/mymetro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://louiss-organization-10.gitbook.io/mymetro/technical-section/x-twitter-integration.md).

# X/Twitter integration

<figure><img src="https://1380514000-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8p4XppkqXWTbYWxdpo2y%2Fuploads%2Fn3OdnEhz4LOUn6WtlmO1%2FFrame%2013.jpg?alt=media&amp;token=3702c0a7-38bc-4e31-9b4f-7440ff553970" alt=""><figcaption></figcaption></figure>

#### The Twitter Integration feature of the mymetro project transforms optimized metro routes into engaging social media content. Each simulation generates a unique metro route where each station is assigned a random word. As the train traverses the route, it collects these words to form a sentence. This sentence is then used to create an AI-generated video, which is posted to our Twitter account.

#### Key Components

1. Word Assignment to Stations
   * Function: Each metro station is pre-assigned a unique, random word from a curated word pool.
   * Purpose: To generate varied and unpredictable sentences based on the train's route.
2. AI-Generated Video Creation
   * Function: Converts the collected sentence into a visually appealing video.
   * Purpose: Enhances social media engagement by providing dynamic and creative content.

***

#### Process Flow

1. Simulation Run
   * AI optimizes a metro route using Ant Colony Optimization algorithms.
   * The optimized route is identified, and each station on the route contributes a word to form a sentence.
2. Sentence Generation
   * Collected words are assembled into a sentence.
   * The sentence is formatted for Twitter compliance.
3. Video Creation
   * The sentence is used to generate an AI-driven video.
   * Visuals and text are combined to create an engaging video narrative.
4. Video Posting
   * The sentence is automatically posted to Twitter via the integrated API.
   * The AI-generated video is uploaded to Twitter.
