# Comprehensive ITB Social Media Interaction Example
## Overview
This example demonstrates how an AI agent uses ITB to interact with a social media interface. It showcases ITB's key features including text collapsing, state management, and complex interactions. The scenario walks through a complete social media interaction flow, from content creation to user engagement.
## User Request to SIA
"I want you to help me create a social media post about my morning hike. I have a photo at '/photos/sunrise.jpg' to share. First, search for similar hiking posts to see what hashtags are popular. Then create a new post with my photo and some engaging text. After posting, find and interact with other hiking-related posts - like them and leave encouraging comments. Finally, send a chat message to anyone who's online and interested in hiking."
## SIA's Response and Actions
### Step 1: Initialize Session
```xml
First, I'll start an ITB session and establish continuous monitoring of the page state.
itb_start "social.html"
```
Expected Output:
```json
{
"pid": 12345,
"session_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "success"
}
```
```xml
itb_screenshot 550e8400-e29b-41d4-a716-446655440000 --wait_stable
```
Initial viewport state:
```xml
SocialConnect | Search posts... | Messages | Notifications
Post
Alice Johnson - 2 hours ago - Just finished my morning hike! The sunrise was absolutely breathtaking today. 🌄 #MorningHike #Nature #Wellness
Like
Comment
Share
Online Friends
Emma Davis (Online)
```
### Step 2: Search for Hiking Posts
```xml
I see the search box in the navigation bar. I'll click it and search for hiking-related posts to analyze common hashtags.
itb_cursor 550e8400-e29b-41d4-a716-446655440000 -x 250 -y 30 --click
itb_input 550e8400-e29b-41d4-a716-446655440000 -t "#hiking"
```
Updated viewport showing search results:
```xml
Search results for "#hiking" - 3 posts found
Alice Johnson - 2 hours ago - Just finished my morning hike! The sunrise was absolutely breathtaking today. 🌄 #MorningHike #Nature #Wellness
David Brown - 1 day ago - Weekend hiking adventure! Found this hidden waterfall trail. #Hiking #Adventure #NaturePhotography
```
### Step 3: Create New Post
```xml
Having analyzed the existing posts and popular hashtags, I'll now create our new post with the sunrise photo.
itb_scroll 550e8400-e29b-41d4-a716-446655440000 -x 0 -y 0
itb_cursor 550e8400-e29b-41d4-a716-446655440000 -x 340 -y 100 --click
itb_input 550e8400-e29b-41d4-a716-446655440000 -t "Starting my day with an invigorating mountain hike! The colors of dawn painted the sky in stunning shades of orange and purple. Nothing beats the serenity of nature in the early morning. 🌄 #MorningHike #Nature #Wellness #SunriseViews"
itb_upload 550e8400-e29b-41d4-a716-446655440000 -i "post_images" -f "/photos/sunrise.jpg"
```
Viewport showing post creation state:
```xml
Starting my day with an invigorating mountain hike! The colors of dawn painted the sky in stunning shades of orange and purple. Nothing beats the serenity of nature in the early morning. 🌄 #MorningHike #Nature #Wellness #SunriseViews
×
```
```xml
itb_cursor 550e8400-e29b-41d4-a716-446655440000 -x 340 -y 160 --click
```
Viewport after post creation:
```xml
You - Just now - Starting my day with an invigorating mountain hike! The colors of dawn painted the sky in stunning shades of orange and purple. Nothing beats the serenity of nature in the early morning. 🌄 #MorningHike #Nature #Wellness #SunriseViews
```
### Step 4: Interact with Related Posts
```xml
Now I'll scroll to find Alice's hiking post and engage with it through likes and comments.
itb_scroll 550e8400-e29b-41d4-a716-446655440000 --to-element "post-actions"
itb_cursor 550e8400-e29b-41d4-a716-446655440000 -x 340 -y 520 --click
```
Viewport after liking:
```xml
Alice Johnson - 2 hours ago - Just finished my morning hike! The sunrise was absolutely breathtaking today. 🌄 #MorningHike #Nature #Wellness
Like
```
```xml
itb_cursor 550e8400-e29b-41d4-a716-446655440000 -x 340 -y 580 --click
itb_input 550e8400-e29b-41d4-a716-446655440000 -t "What a gorgeous view! I just did a morning hike too. The sunrise is always worth the early wake-up call! 🌅"
```
### Step 5: Start a Chat
```xml
I notice Emma Davis is online and has hiking photos. I'll initiate a conversation about hiking.
itb_cursor 550e8400-e29b-41d4-a716-446655440000 -x 960 -y 200 --click
```
Viewport showing chat window:
```xml
Emma Davis (Online)
```
```xml
itb_input 550e8400-e29b-41d4-a716-446655440000 -t "Hi Emma! I noticed you're into hiking too. Would you be interested in joining for a sunrise hike sometime? I just discovered some beautiful trails!"
```
Final viewport state:
```xml
Emma Davis (Online)
You - Just now - Hi Emma! I noticed you're into hiking too. Would you be interested in joining for a sunrise hike sometime? I just discovered some beautiful trails!
```
```xml
I've completed all requested interactions:
1. Analyzed existing hiking posts and hashtags
2. Created a new post with photo and appropriate hashtags
3. Engaged with Alice's hiking post through a like and comment
4. Initiated a conversation with Emma about hiking
The continuous screenshot monitoring remains active to catch any responses.
```
## Key Features Demonstrated
This example illustrates several important ITB features:
1. Text Collapsing: Related text elements are automatically combined into natural reading flows, such as "Author - Time - Content" for posts.
2. State Management: The viewport maintains awareness of scroll position, focus state, and interactive element states throughout the session.
3. Interactive Elements: The example shows how ITB handles various types of interaction including:
- Text input fields
- File uploads
- Clickable buttons
- Scrollable areas
- Modal windows (chat widget)
4. Media Handling: Images are represented with their position, size, and alt text while maintaining proper layout relationships with surrounding content.
5. Dynamic Content: The example demonstrates how ITB handles dynamic content updates like:
- Search results loading
- Post creation
- Chat window opening
- Comment threading
This comprehensive example shows how ITB transforms complex web interfaces into a format that AI agents can effectively process and interact with while maintaining all the functionality a human user would have.