@@ -40,7 +40,7 @@ Different operations have different quota costs:
4040
4141tuber provides built-in quota tracking:
4242
43- ``` {r quota-tracking}
43+ ``` {r quota-tracking, eval=FALSE }
4444library(tuber)
4545
4646# Check current quota usage
@@ -58,7 +58,7 @@ quota_status$reset_time # When quota resets (midnight Pacific Time)
5858
5959If you've requested a quota increase from Google, update your limit:
6060
61- ``` {r set-quota}
61+ ``` {r set-quota, eval=FALSE }
6262# Set a custom quota limit
6363yt_set_quota_limit(50000)
6464
@@ -78,7 +78,7 @@ Best for **read-only public data**:
7878- Fetching channel information
7979- Reading public comments
8080
81- ``` {r api-key}
81+ ``` {r api-key, eval=FALSE }
8282# Set up API key (get one from Google Cloud Console)
8383yt_set_key("YOUR_API_KEY")
8484
@@ -102,7 +102,7 @@ Required for:
102102- Deleting resources
103103- Accessing user's own channel data
104104
105- ``` {r oauth}
105+ ``` {r oauth, eval=FALSE }
106106# Set up OAuth2 (opens browser for authentication)
107107yt_oauth("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
108108
@@ -138,7 +138,7 @@ When working with many videos or channels, batch processing is essential for eff
138138
139139### Processing Multiple Videos
140140
141- ``` {r batch-videos}
141+ ``` {r batch-videos, eval=FALSE }
142142# Get details for multiple videos at once
143143video_ids <- c("dQw4w9WgXcQ", "M7FIvfx5J10", "kJQP7kiw5Fk")
144144
@@ -157,7 +157,7 @@ head(videos)
157157
158158tuber provides high-level functions for common analysis tasks:
159159
160- ``` {r bulk-analysis}
160+ ``` {r bulk-analysis, eval=FALSE }
161161# Comprehensive video analysis
162162analysis <- bulk_video_analysis(
163163 video_ids = video_ids,
@@ -189,7 +189,7 @@ comparison <- compare_channels(
189189
190190tuber automatically handles pagination for large result sets:
191191
192- ``` {r pagination}
192+ ``` {r pagination, eval=FALSE }
193193# Request more items than API allows per page (50)
194194# tuber automatically makes multiple API calls
195195playlist_items <- get_playlist_items(
@@ -214,7 +214,7 @@ YouTube API responses contain nested JSON. Here's how to work with them.
214214
215215Most functions flatten nested data into data frames:
216216
217- ``` {r extract-simple}
217+ ``` {r extract-simple, eval=FALSE }
218218# Get simplified output
219219videos <- get_video_details(
220220 video_ids = "dQw4w9WgXcQ",
@@ -233,7 +233,7 @@ videos$channelTitle
233233
234234When you need the full nested structure:
235235
236- ``` {r extract-raw}
236+ ``` {r extract-raw, eval=FALSE }
237237# Get raw API response
238238videos_raw <- get_video_details(
239239 video_ids = "dQw4w9WgXcQ",
@@ -251,7 +251,7 @@ video$contentDetails$duration
251251
252252### Common Field Access Patterns
253253
254- ``` {r field-patterns}
254+ ``` {r field-patterns, eval=FALSE }
255255# Video details
256256videos$snippet.title # Title
257257videos$snippet.description # Description
@@ -275,7 +275,7 @@ comments$snippet.topLevelComment.snippet.likeCount
275275
276276### Using with_retry for Transient Errors
277277
278- ``` {r retry}
278+ ``` {r retry, eval=FALSE }
279279# Automatic retry with exponential backoff
280280result <- with_retry(
281281 get_video_details(video_ids = "dQw4w9WgXcQ", auth = "key"),
@@ -286,7 +286,7 @@ result <- with_retry(
286286
287287### Handling Quota Exhaustion
288288
289- ``` {r quota-handling}
289+ ``` {r quota-handling, eval=FALSE }
290290# Check before making requests
291291quota <- yt_get_quota_usage()
292292if (quota$quota_remaining < 100) {
@@ -305,7 +305,7 @@ tryCatch({
305305
306306### Rate Limiting Best Practices
307307
308- ``` {r rate-limiting}
308+ ``` {r rate-limiting, eval=FALSE }
309309# Add delays between requests
310310video_ids <- c("id1", "id2", "id3", "id4", "id5")
311311
@@ -319,7 +319,7 @@ results <- lapply(video_ids, function(vid) {
319319
320320tuber includes built-in caching for frequently accessed data:
321321
322- ``` {r caching}
322+ ``` {r caching, eval=FALSE }
323323# Configure cache
324324tuber_cache_config(
325325 enabled = TRUE,
@@ -344,7 +344,7 @@ tuber_cache_clear()
344344
345345### Example 1: Analyze a Channel's Performance
346346
347- ``` {r example-channel}
347+ ``` {r example-channel, eval=FALSE }
348348# Full channel analysis
349349analysis <- analyze_channel(
350350 channel_id = "UCuAXFkgsw1L7xaCfnd5JJOw",
@@ -361,7 +361,7 @@ cat("Engagement rate:", analysis$performance_metrics$engagement_rate, "\n")
361361
362362### Example 2: Trending Analysis
363363
364- ``` {r example-trending}
364+ ``` {r example-trending, eval=FALSE }
365365# Analyze trending topics
366366trends <- analyze_trends(
367367 search_terms = c("machine learning", "AI", "data science"),
@@ -382,7 +382,7 @@ cat("Total views:", best_trend$total_views, "\n")
382382
383383### Example 3: Efficient Video Processing
384384
385- ``` {r example-batch}
385+ ``` {r example-batch, eval=FALSE }
386386# Get all videos from a playlist
387387playlist_videos <- get_playlist_items(
388388 playlist_id = "PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf",
@@ -430,7 +430,7 @@ avg_duration <- mean(as.numeric(video_stats$duration), na.rm = TRUE)
430430
431431### Getting Help
432432
433- ``` {r help}
433+ ``` {r help, eval=FALSE }
434434# Check function documentation
435435?get_video_details
436436?yt_search
0 commit comments