Second Brain: Crafted, Curated, Connected, Compounded on 10月02日
AT Protocol:构建开放社交应用的框架
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

AT Protocol(Authenticated Transfer Protocol,简称atproto)是一个开放的公共对话标准和构建社交应用的开源框架。它通过为用户身份、关注关系和社交数据创建标准化格式,实现了不同社交应用的互操作性,并允许用户在它们之间自由迁移。该协议建立在一个联邦网络之上,并支持账户的便携性。Bluesky等应用已采用此协议。

🔵 **开放标准与开源框架**:AT Protocol(atproto)旨在为公共对话和社交应用开发提供一个统一的标准和开源框架。它通过定义用户身份、关注关系和数据格式,打破了传统社交应用的孤岛效应,促进了应用的互联互通。

🤝 **互操作性与账户便携性**:该协议的核心在于实现不同社交应用之间的互操作性。用户能够自由地在这些应用之间迁移,而无需担心数据丢失或身份隔离,这得益于其联邦网络架构和账户可移植性设计。

🛠️ **数据访问与分析工具**:文章列举了多种用于访问和分析AT Protocol数据的工具,包括Jetstream Tools、DuckDB和Skyfirehose。这些工具使得开发者和分析师能够更有效地查询和处理存储在Firehose协议中的数据,而非依赖于传统的REST API。

The AT Protocol at:// (Authenticated Transfer Protocol, or atproto) is a standard for public conversation and an open-source framework for building social apps.

It creates a standard format for user identity, follows, and data on social apps, allowing apps to interoperate and users to move across them freely. It is a federated network with account portability.

Used by Bluesky. Frontpage and Smoke Signal (see below ).

Read Basic Concepts, Identity, Data repositories​, Federation and more.

Besides the dedicated tools to Bluesky, here are the more related to extract and ATProto.

# Web Applications

# Data Analysis & Processing

    Jetstream Tools:Data Tools & Tutorials:Dashboards

# Data Access & Querying

    DuckDB Resources:
      Hive Catalog - Access via https://hive.buz.dev/bluesky/catalog or via select * from read_parquet('https://hive.buz.dev/bluesky/jetstream/latest.parquet') by Jake ThomasSkyfirehose - Query Jetstream with DuckDB
    Firehose Access:

Based on Jetstream: Shrinking the AT Proto Firehose by >99% · Jaz’s Blog, it’s better to access data through their Firehose protocol rather than REST APIs.

# DuckDB

But there’s a browser for checking your content:

# Bsky Engagement Stats

or stats (origin on bsky):

# Query
 1 2 3 4 5 6 7 8 91011121314151617181920212223242526272829303132333435363738
-- Charting bars with engagement metricsWITH raw_data AS (  SELECT * FROM read_json_auto('https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=did:plc:edglm4muiyzty2snc55ysuqx&limit=100')),unnested_feed AS (  SELECT unnest(feed) as post_data FROM raw_data),engagement_data AS (  SELECT     RIGHT(post_data.post.uri, 13) as post_uri,    --post_data.post.uri as post_uri,    post_data.post.author.handle,    LEFT(post_data.post.record.text, 50) as post_text,    post_data.post.record.createdAt as created_at,    (post_data.post.replyCount +      post_data.post.repostCount +      post_data.post.likeCount +      post_data.post.quoteCount) as total_engagement,      post_data.post.replyCount as replies,      post_data.post.repostCount as reposts,      post_data.post.likeCount as likes,      post_data.post.quoteCount as quotes,  FROM unnested_feed)SELECT   post_uri,  created_at,  total_engagement,  bar(total_engagement, 0,       (SELECT MAX(total_engagement) FROM engagement_data),       30) as engagement_chart,  replies, reposts, likes, quotes,  post_text,FROM engagement_dataWHERE handle = 'ssp.sh'ORDER BY total_engagement DESCLIMIT 30;  

# Reading Posts

Bsky and GitHub Gist

# Query

or reading the posts:

 1 2 3 4 5 6 7 8 9101112131415161718192021222324252627282930313233343536373839404142434445
-- Query the API directly and flatten the nested JSON structureWITH raw_data AS (  SELECT * FROM read_json_auto('https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=did:plc:edglm4muiyzty2snc55ysuqx&limit=10')),unnested_feed AS (  SELECT unnest(feed) as post_data FROM raw_data)SELECT   -- Post basics  post_data.post.uri as post_uri,  post_data.post.author.handle as author_handle,  post_data.post.author.displayName as display_name,    -- Post content  post_data.post.record.text as post_text,  post_data.post.record.createdAt as created_at,    -- Engagement metrics  post_data.post.replyCount as replies,  post_data.post.repostCount as reposts,  post_data.post.likeCount as likes,  post_data.post.quoteCount as quotes,    -- Embedded content (if available)  CASE     WHEN post_data.post.embed IS NOT NULL     AND post_data.post.embed['$type'] = 'app.bsky.embed.external#view'     THEN post_data.post.embed.external.uri    ELSE NULL  END as embedded_link,    CASE     WHEN post_data.post.embed IS NOT NULL     AND post_data.post.embed['$type'] = 'app.bsky.embed.external#view'     THEN post_data.post.embed.external.title    ELSE NULL  END as embedded_title,    -- Total engagement score  (post_data.post.replyCount +    post_data.post.repostCount +    post_data.post.likeCount +    post_data.post.quoteCount) as total_engagementFROM unnested_feedORDER BY created_at DESC;

Uploaded to Reading bsky posts with DuckDB example. · GitHub, too.

# Get Unique ID

Get the Unique ID of my User through public API using HTTPS community extension

 1 2 3 4 5 6 7 8 910111213
D WITH __input AS (    SELECT      http_get('https://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle?handle=ssp.sh') AS res  )  SELECT    res::json->>'body' as identity_json  FROM __input;┌────────────────────────────────────────────┐               identity_json                                  varchar                   ├────────────────────────────────────────────┤ {"did":"did:plc:edglm4muiyzty2snc55ysuqx"} └────────────────────────────────────────────┘

# Graph: Accounts within 5 hops

Interesting discovery: there are roughly 9,000 accounts within 5 hops of those I currently follow! 🚀 (I assume I didn’t mess up the data gathering) Powered by duckdb with the seamless
SQL / PGQ syntax supported in the DuckPGQ extension. Amazing what you can uncover with the right tools! Post by @dtenwolde.bsky.social — Blueskhttps://www.ssp.sh/brain/AT%20Protocol-20241030173449539.webpAT%20Protocol-20241030173449539.webp">

Check some stuff on Future of Web, and Bluesky

Just wapping the relevant macros to do the queries. pivot_table – DuckDB Community Extensions (by @a13x.bsky.social ) is a good example of an extension that just exposes a bunch of SQL macros, chsql – DuckDB Community Extensions is another cool one in that vibe. Post by @carlopi.bsky.social — Bluesky


Origin: Bluesky protocol
References:
Created 2024-10-30

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

AT Protocol Bluesky 开源框架 社交应用 去中心化 数据分析 Open Source Social Apps Decentralization Data Analysis
相关文章