File size: 11,204 Bytes
a15899d 378061d a15899d e493ce9 a15899d 378061d a15899d 378061d a15899d 378061d a15899d 378061d a15899d 378061d 1c2309c a15899d 1c2309c 378061d a15899d 378061d a15899d 378061d 4dad000 378061d 4dad000 6587f68 378061d 6587f68 378061d 1c2309c 378061d 2539c81 378061d 1c2309c 894f32f 378061d a15899d 378061d a15899d 378061d 063637d 378061d 063637d 378061d 063637d 378061d 063637d 2539c81 063637d 378061d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
---
license: cc-by-4.0
---
# Bluesky Aozora Dive
![image/png](https://cdn-uploads.huggingface.co/production/uploads/633e85093a17ab61de8d9073/fHxDf5LJ5wz7-guCDAcmn.png "Before someone screams, This is an AI generated image. No waifu this time.")
... Is an archive of atproto's firehose (and relatedly bluesky) streams.
This dataset name is inspired from a [song](https://www.uta-net.com/song/295599/).
## Data Formats
We present data as is with minimum enrichment.
- Any cryptographic CIDs are stripped as they do not possess any useful textual data.
### Streams
The firehose is split into 2 jsonl file for your usage:
- `..._atproto_interactions.jsonl`: Contains interaction events, such as likes, follows, reposts and blocks
- `..._atproto_general.jsonl`: Contains accounts, identities, posts and replies
### Common Fields
- `typ`: Represents the data **typ**e.
- `usr`: Which **Us**e**r** is it from. Represented in the `Usernames` format below.
- `rid`: Record Key. Use this to access data from bsky api.
The most basic root construct will typically contain:
```json
{
"typ": "<Type>",
"usr": {
"did": "did:plc:ssd5xwqvrdrxyu2br7sfjwzy",
},
}
```
Usernames are constructed in the following format:
```json
{
"did": "did:plc:4hqjfn7m6n5hno3doamuhgef",
}
```
`did`: `Decentralized ID`. Consider this as `ID` for most cases and it points to a unique ID.
`nms`: **[DEPRECATED!]** `Usernames`. Either can be a string or a list of strings. Do not blindly assume this is going to be only a string! Though generally, it should just be a string.
- **`nms`** will not be provided in future firehose archives. Turns out PLC directory didn't like me.
For most cases, expect the did to describe a user.
### Blobs
Blobs represent media content. Typically you can tell it's a blob if it has a `mime` field and a `cid`.
```json
{
"mime": "image/jpeg",
"size": 891965,
"cid": "bafkreifu35fvx45eyldhpoyb3zgtb5dobvjfpw5kkeexwxefrfpzye2pji"
}
```
Given the user account is this:
```json
{
"typ": "account",
"usr": {
"did": "did:plc:lri5xcv6ogaldxkigm32wa57",
"avy": {
"mime": "image/jpeg",
"size": 226086,
"cid": "bafkreif3z2y2rfrfcjt4rwwps4ib7q7qywrdt76bw6dmj5ebqefgllpima"
},
"bnr": null,
"crt": 1723726663.57,
"dsc": "――あなたの日常に、AIの籠った音色を。\n\n▼思い出や日常、希望をお聞かせください。その想いを曲にいたします。\nhttps://forms.gle/rF2iqwXxabfVEifd7",
"dsp": "雪白ゆっち feat.AI Creator"
}
}
```
Construct the avy url like so:
Template: `https://bsky.social/xrpc/com.atproto.sync.getBlob?did=<usr.did>&cid=<usr.avy.cid>`
A full link looks like this: `https://bsky.social/xrpc/com.atproto.sync.getBlob?did=did:plc:lri5xcv6ogaldxkigm32wa57&cid=bafkreif3z2y2rfrfcjt4rwwps4ib7q7qywrdt76bw6dmj5ebqefgllpima`
Yes I did spend a while trying to lookup to see why it is not working.
### Posts (Simple)
Posts can get rather complicated. Here's a sample of a simple post.
```json
{
"typ": "post",
"usr": {
"did": "did:plc:ssd5xwqvrdrxyu2br7sfjwzy",
},
"rid": "3kzyon77od52v",
"chg": "create",
"tst": 1723987630.494,
"pst": {
"txt": "✔✔✔On Aug 18, 2024, 11:59 AM(UTC). According to Binance Market Data, Bitcoin has crossed the 60,000 USDT benchmark and is now trading at 60,006.578125 USDT, with a narrowed 1.49% increase in 24 hours.👀👀",
"emb": null,
"fct": [],
"lbl": [],
"lng": [],
"tgs": [],
"rpl": null
}
}
```
- `tst`: Contains the timestamp in unix float time.
- `chg`: Change type. Typically either `create` or `delete` for posts. `change` for allowing Direct Messages.
- `rid`: Record Key. Use this to access data from bsky api.
- `pst`: Contains the actual posted data.
### Posts (Complex)
As for replies and other fields, here's a more complex example.
```json
{
"typ": "reply",
"usr": {
"did": "did:plc:4hqjfn7m6n5hno3doamuhgef",
"nms": "yui.syui.ai"
},
"rid": "3kzyotm2hzq2d",
"chg": "create",
"tst": 1723987844.937,
"pst": {
"txt": "https://card.syui.ai/baiser \nbaiser\njoin : baiser.blue [IIT]\nten : 1000\naiten : 21037247\n---\n[1-7]\nten d : shuffle[IIT☑]\nten p : post\n---\n",
"emb": null,
"fct": [
{
"typ": "@",
"val": "https://card.syui.ai/baiser",
"rng": [
0,
27
]
}
],
"lbl": [],
"lng": [],
"tgs": [],
"rpl": {
"typ": "post",
"usr": {
"did": "did:plc:vok247eewjmbmo3kxaizct2i",
"nms": "baiser.blue"
},
"rid": "3kzyotbooo22c",
"rrt": {
"typ": "post",
"usr": {
"did": "did:plc:vok247eewjmbmo3kxaizct2i",
"nms": "baiser.blue"
},
"rid": "3kzyosf6atg2v"
}
}
}
}
```
- `fct`: Stands for Facets:
- `typ`: The facet type. (`tag`,`link`,`mention`)
- `val`: The facet value. Note that this can be a `Username` dict when `typ` == `mention`
- `rng`: Byte range. AFAIK this is in UTF-16 but I can be wrong. Follow atproto's docs for this.
- `lbl`: Labels. A list of strings. Though typically empty list for firehose streams. Labels are sent seperately firehose stream-wise.
- `lng`: Languages. Either an list (Can be empty) or a string.
- `tgs`: "Additional hashtags, in addition to any included in post text and facets."
- `rpl`: The post that the current post is replying to.
- *Note:* The reply post is not enriched with the actual post.
- `typ`/`usr`/`rid`: [Refer to the simple posts section.](#posts-simple)
- `rrt`: Root post. Can be `null` if root post is the same as the `rpl` post `rid`.
- `emb`: Any rich embed.
- Embed primarily has around 5 types
1. Images
- A list of images.
- Each image contains: `img` (BlobRef), `alt` (Alt Text), `isz` (Size)
3. Video
- A Video
- Contains the following fields: `vid`, `alt` (Alt Text), `isz` (Size), `cpt` (Captions, Dictionary with of key for languages and a BlobRef for value)
4. External (Outside bluesky)
- Typically webpages and the like
5. w/ Record (A post that has a link to another person)
6. Same as 5 but with Images.
- TL;DR: Embeds are complicated.
### Accounts
```json
{
"typ": "account",
"usr": {
"did": "did:plc:cj3ngde5wbljf5sh33g7zsdz",
"avy": {
"mime": "image/jpeg",
"size": 79776,
"cid": "bafkreiczz2spptgturm43r33impbkcar4tmdmnh34pqkp2tynlztbxmw7a"
},
"bnr": {
"mime": "image/jpeg",
"size": 748930,
"cid": "bafkreigb5l3u32quxzhpbca6bnrunfdau3m4bp6fdntmj2lwec3erkssty"
},
"crt": null,
"dsc": "こっちでは、主に練習中の下手なイラスト・ゲーム関系とかを投稿していきたいな〜\n\n最推しのねくろさんの配信を見るといやされる( ◠‿◠ )",
"dsp": "しろっつ🖤🐐👑"
}
}
```
For Accounts, the `usr` field is more filled. In addition to `did`, there are other fields like:
- `avy`/`bnr`: either a `Blob` or null. Refer to [Blobs](#blobs) section above.
- `crt`: Account Creation time. Can be null!
- `dsc`: Profile Bio / Blurb Section.
- `dsp`: Display name.
### Reconstructing to a AtUri
For `post` and `reply` types, Take the following values and combine them into the following url:
`at://<usr.did>/app.bsky.feed.post/<rid>`
Replies are just posts.
For `repost` and `like` types, it's similar but a bit different:
- Reposts: `at://<usr.did>/app.bsky.feed.repost/<rid>`
- likes: `at://<usr.did>/app.bsky.feed.like/<rid>`
### Enrichment of replies
```
curl -L -X GET 'https://public.api.bsky.app/xrpc/app.bsky.feed.getPosts?uris=at://did:plc:4hqjfn7m6n5hno3doamuhgef/app.bsky.feed.post/3kzyotm2hzq2d' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
```
### "Miracle Spec"
Recently, some creative folks have started adding their own data to the atproto stream. Some notable examples I saw are:
- `com.whtwnd.blog.entry` (https://whtwnd.com/about)
- `space.aoisora.bookmark` (https://bsky.app/profile/mimonelu.net/post/3l4ta2mdqwe2s)
As of 01/10/24, I've added support for those.. They are labeled as "MiracleRoad!" for `typ` and only contain the raw record data.
### Illegal Spec Followers
In other words, we also capture content that failed to follow specs. Like this:
```json
{
"typ": "IllegalSpecFollowerAkaFixYourShit",
"record": {
"text": "任某(男,31歲),被行拘! ",
"$type": "app.bsky.feed.post",
"embed": {
"uri": "https://www.headline01.com/a/Xio3zSUuGvX7J1jCSG_F5g-51479340.html",
"$type": "app.bsky.embed.external#main",
"external": {
"uri": "https://www.headline01.com/a/Xio3zSUuGvX7J1jCSG_F5g-51479340.html",
"thumb": {
"ref": "bafkreidrfrfluqo26yy4pemkcpgug2p5sea3xrwh3schfnns5owa7gbwvm",
"size": 86924,
"$type": "blob",
"mimeType": "image/jpeg"
},
"title": "任某(男,31歲),被行拘!",
"description": ""
}
},
"createdAt": "2024-08-18T14:05:19.645644Z"
}
}
```
Lines marked as `IllegalSpecFollowerAkaFixYourShit` should be ignored in general though. Content isn't great anyway.
## Changes
**[01/09/24]**
Removed mentions of `nms`. We stopped resolving DIDs after 01/09/24 as it appears that I'm slamming PLC directory too much lol. Sorry!
**[04/09/24]**
Fixed video embeds as it started to crash the scraper resuling in some missing stuff.
## Various Notes
### Recommendations
For getting a more proper stream of posts, it's recommended to keep a track of users + posts in a index cache.
Then again, you can just fetch a list from bsky api directly lol.
Do consider reading up on bsky docs and atproto docs.
### Docs Nonsense
When the bluesky docs say: "...Implemented by PDS".
You should probably use the following base url: `https://bsky.social/xrpc/`
### Deletions
UnActions ("unpost","unlike","unrepost") only contains `rid` as the record key.
### License
For everyone out there, data is meant to be free unlike some previous license I did. This is free for grabs aka `CC-BY-4.0`.
for Big Corps wanting to use it: Sure. As long as you cite this dataset + `CC-BY-4.0` license. Be nice to people who have came before you and did it.
### Citations
We would much love academia to cite this dataset. Be nice please `:)`
```tex
@misc{bskyaozora,
title = {Aozora Diving: diving into the sea of atproto and bluesky network },
author = {KaraKaraWitch},
year = {2024},
howpublished = {\url{https://huggingface.co/datasets/WitchesSocialStream/bluesky-Aozora-Diving}},
}
``` |