or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

blog-content.mdclient-configuration.mdcontent-discovery.mdhttp-requests.mdindex.mdpost-management.mdsocial-interactions.mduser-management.md
tile.json

blog-content.mddocs/

Blog Information and Content

Retrieve comprehensive blog information, posts, and various blog-specific content including queue, drafts, submissions, and avatars.

Capabilities

Blog Information

Get detailed information about a specific blog.

/**
 * Get information about a blog
 * @param blogIdentifier - Blog name or URL
 * @param params - Optional field selection parameters
 * @returns Promise resolving to blog information
 */
blogInfo(blogIdentifier: string, params?: { 'fields[blogs]'?: string }): Promise<any>;

Usage Examples:

// Get basic blog information
const blogInfo = await client.blogInfo('staff');
console.log(blogInfo.blog.title);        // "Tumblr Staff"
console.log(blogInfo.blog.description);  // Blog description
console.log(blogInfo.blog.total_posts);  // Total post count

// Get specific fields only
const limitedInfo = await client.blogInfo('staff', {
  'fields[blogs]': 'name,title,description,url'
});

Blog Posts

Retrieve posts from a blog with extensive filtering and pagination options.

/**
 * Get posts for a blog
 * @param blogIdentifier - Blog name or URL
 * @param params - Post filtering and pagination parameters
 * @returns Promise resolving to blog posts
 */
blogPosts(blogIdentifier: string, params?: BlogPostsParams): Promise<any>;

Usage Examples:

// Get recent posts
const recentPosts = await client.blogPosts('staff');
console.log(recentPosts.posts.length);

// Get specific post by ID
const specificPost = await client.blogPosts('staff', {
  id: '12345'
});

// Filter by post type
const photoPosts = await client.blogPosts('staff', {
  type: 'photo',
  limit: 20
});

// Filter by tags (posts must have ALL specified tags)
const taggedPosts = await client.blogPosts('staff', {
  tag: ['announcement', 'features'],
  limit: 10
});

// Get posts with additional metadata
const detailedPosts = await client.blogPosts('staff', {
  reblog_info: true,
  notes_info: true,
  npf: true  // Return NPF format instead of legacy
});

// Pagination
const olderPosts = await client.blogPosts('staff', {
  limit: 20,
  offset: 20
});

Blog Queue

Get queued posts for a blog (requires authentication and blog ownership).

/**
 * Get the queue for a blog
 * @param blogIdentifier - Blog name or URL
 * @param params - Queue filtering parameters
 * @returns Promise resolving to queued posts
 */
blogQueue(blogIdentifier: string, params?: QueueParams): Promise<any>;

Usage Examples:

// Get all queued posts
const queuedPosts = await client.blogQueue('myblog');

// Get limited queue with filtering
const queue = await client.blogQueue('myblog', {
  limit: 10,
  offset: 0,
  filter: 'text'  // 'text' or 'raw'
});

Blog Drafts

Get draft posts for a blog (requires authentication and blog ownership).

/**
 * Get drafts for a blog
 * @param blogIdentifier - Blog name or URL
 * @param params - Draft filtering parameters
 * @returns Promise resolving to draft posts
 */
blogDrafts(blogIdentifier: string, params?: DraftsParams): Promise<any>;

Usage Examples:

// Get all drafts
const drafts = await client.blogDrafts('myblog');

// Get drafts with filtering
const recentDrafts = await client.blogDrafts('myblog', {
  before_id: 67890,
  filter: 'text'
});

Blog Submissions

Get submission posts for a blog (requires authentication and blog ownership).

/**
 * Get submissions for a blog
 * @param blogIdentifier - Blog name or URL
 * @param params - Submission filtering parameters
 * @returns Promise resolving to submission posts
 */
blogSubmissions(blogIdentifier: string, params?: SubmissionsParams): Promise<any>;

Usage Examples:

// Get all submissions
const submissions = await client.blogSubmissions('myblog');

// Get submissions with pagination
const pagedSubmissions = await client.blogSubmissions('myblog', {
  offset: 10,
  filter: 'raw'
});

Blog Avatar

Get the avatar URL for a blog in various sizes.

/**
 * Get avatar URL for a blog
 * @param blogIdentifier - Blog name or URL
 * @param size - Avatar size in pixels
 * @returns Promise resolving to avatar URL data
 */
blogAvatar(blogIdentifier: string, size?: AvatarSize): Promise<any>;

Usage Examples:

// Get default avatar size
const avatar = await client.blogAvatar('staff');
console.log(avatar.avatar_url);

// Get specific avatar size
const largeAvatar = await client.blogAvatar('staff', 512);
const smallAvatar = await client.blogAvatar('staff', 64);

Parameter Types

Blog Posts Parameters

interface BlogPostsParams {
  /** Specific post ID - returns single post or 404 */
  id?: string;
  /** Filter by tags - posts must have ALL specified tags (max 4) */
  tag?: string | string[];
  /** Filter by post type */
  type?: PostType;
  /** Number of posts to return (1-20) */
  limit?: number;
  /** Offset for pagination (0 to start from first post) */
  offset?: number;
  /** Include reblog information */
  reblog_info?: boolean;
  /** Include notes information and metadata */
  notes_info?: boolean;
  /** Return NPF format instead of legacy format */
  npf?: boolean;
}

type PostType = 'text' | 'quote' | 'link' | 'answer' | 'video' | 'audio' | 'photo' | 'chat';

Queue Parameters

interface QueueParams {
  /** Number of posts to return */
  limit?: number;
  /** Offset for pagination */
  offset?: number;
  /** Post format filter */
  filter?: PostFormatFilter;
}

type PostFormatFilter = 'text' | 'raw';

Draft Parameters

interface DraftsParams {
  /** Return drafts before this post ID */
  before_id?: number;
  /** Post format filter */
  filter?: PostFormatFilter;
}

Submission Parameters

interface SubmissionsParams {
  /** Offset for pagination */
  offset?: number;
  /** Post format filter */
  filter?: PostFormatFilter;
}

Avatar Size Type

type AvatarSize = 16 | 24 | 30 | 40 | 48 | 64 | 96 | 128 | 512;

Response Data Examples

Blog Info Response

{
  blog: {
    title: "Tumblr Staff",
    name: "staff",
    total_posts: 1682,
    posts: 1682,
    url: "https://staff.tumblr.com/",
    updated: 1461979830,
    description: "The world's *first* content-free social network",
    is_nsfw: false,
    ask: false,
    ask_anon: false,
    followed: true,
    can_send_fan_mail: true,
    share_likes: false,
    subscribed: false,
    can_subscribe: true
  }
}

Blog Posts Response

{
  posts: [
    {
      id: "12345",
      type: "text",
      blog_name: "staff",
      timestamp: 1461979830,
      date: "2016-04-29 22:23:50 GMT",
      format: "html",
      reblog_key: "abc123",
      tags: ["announcement", "features"],
      title: "New Features!",
      body: "<p>We've added some great new features...</p>",
      note_count: 42,
      summary: "New features announcement"
    }
    // ... more posts
  ],
  total_posts: 1682
}

Authentication Requirements

Public Access (No Auth Required)

  • blogInfo() - Basic blog information
  • blogPosts() - Public blog posts
  • blogAvatar() - Blog avatar URLs

API Key Required

  • blogInfo() - Enhanced blog information
  • blogPosts() - Enhanced post data and filtering

OAuth Required

  • blogQueue() - Requires blog ownership
  • blogDrafts() - Requires blog ownership
  • blogSubmissions() - Requires blog ownership

Error Handling

Common error scenarios and handling:

try {
  const posts = await client.blogPosts('nonexistent-blog');
} catch (error) {
  if (error.message.includes('404')) {
    console.error('Blog not found');
  } else if (error.message.includes('403')) {
    console.error('Blog is private or restricted');
  }
}

try {
  const queue = await client.blogQueue('someone-elses-blog');
} catch (error) {
  if (error.message.includes('401')) {
    console.error('Authentication required');
  } else if (error.message.includes('403')) {
    console.error('Not authorized to access this blog\'s queue');
  }
}

Pagination Strategies

Offset-based Pagination

async function getAllPosts(blogName) {
  const allPosts = [];
  let offset = 0;
  const limit = 20;
  
  while (true) {
    const response = await client.blogPosts(blogName, { limit, offset });
    
    if (response.posts.length === 0) {
      break; // No more posts
    }
    
    allPosts.push(...response.posts);
    offset += limit;
    
    if (response.posts.length < limit) {
      break; // Last page
    }
  }
  
  return allPosts;
}

ID-based Pagination (for drafts)

async function getAllDrafts(blogName) {
  const allDrafts = [];
  let beforeId = null;
  
  while (true) {
    const params = beforeId ? { before_id: beforeId } : {};
    const response = await client.blogDrafts(blogName, params);
    
    if (response.posts.length === 0) {
      break;
    }
    
    allDrafts.push(...response.posts);
    beforeId = response.posts[response.posts.length - 1].id;
  }
  
  return allDrafts;
}