KaraKaraWitch commited on
Commit
378061d
1 Parent(s): 063637d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +262 -13
README.md CHANGED
@@ -1,11 +1,11 @@
1
  ---
2
- license: apache-2.0
3
  ---
4
  # Bluesky Aozora Dive
5
 
6
  ... Is an archive of atproto's firehose (and relatedly bluesky) streams.
7
 
8
- [Repo currently up for marking reasons.]
9
 
10
  ## Data Formats
11
 
@@ -14,22 +14,264 @@ We present data as is with minimum enrichment.
14
  - Likes authors are enriched with their author and usernames. The post themselves are not enriched since that will incur additional requests which can be quite heavy.
15
  - Any cryptographic CIDs are stripped as they do not possess any useful textual data.
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  Usernames are constructed in the following format:
 
18
  ```json
19
  {
20
- "did": "did:plc:5pg23j2334q5gcidzk6ps57c",
21
- "uns": "phietje.bsky.social"
22
  }
23
  ```
24
 
25
- do note that usernames may be a list of usernames if the `did` user has morethan 1 username.
 
26
 
27
- ## Various Notes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- ### Terms
30
 
31
- `did` -> `Decentralized ID`. Consider this as `ID` for most cases and it points to a unique ID.
32
- `uns` -> `Usernames`. Either can be a single string or a list of usernames. Do not blindly assume this is going to be only a string!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  ### Recommendations
35
 
@@ -39,24 +281,31 @@ Then again, you can just fetch a list from bsky api directly lol.
39
 
40
  Do consider reading up on bsky docs and atproto docs.
41
 
 
 
 
 
 
 
42
  ### Deletions
43
 
44
  UnActions ("unpost","unlike","unrepost") only contains `rid` as the record key.
45
 
46
  ### License
47
 
48
- For everyone out there, data is meant to be free unlike some previous license I did.
49
 
 
50
 
51
  ### Citations
52
 
53
- We would love academia to cite this dataset. Be nice please :)
54
 
55
- ```
56
  @misc{bskyaozora,
57
  title = {Aozora Diving: diving into the sea of atproto and bluesky network },
58
  author = {KaraKaraWitch},
59
  year = {2023},
60
  howpublished = {\url{https://huggingface.co/datasets/WitchesSocialStream/bluesky-Aozora-Diving}},
61
  }
62
- ```
 
1
  ---
2
+ license: cc-by-4.0
3
  ---
4
  # Bluesky Aozora Dive
5
 
6
  ... Is an archive of atproto's firehose (and relatedly bluesky) streams.
7
 
8
+ This dataset name is inspired from a [song](https://www.uta-net.com/song/295599/).
9
 
10
  ## Data Formats
11
 
 
14
  - Likes authors are enriched with their author and usernames. The post themselves are not enriched since that will incur additional requests which can be quite heavy.
15
  - Any cryptographic CIDs are stripped as they do not possess any useful textual data.
16
 
17
+ ### Streams
18
+
19
+ The firehose is split into 2 jsonl file for your usage:
20
+
21
+ - `..._atproto_interactions.jsonl`: Contains interaction events, such as likes, follows, reposts and blocks
22
+ - `..._atproto_general.jsonl`: Contains accounts, identities, posts and replies
23
+
24
+ ### Common Fields
25
+
26
+ - `typ`: Represents the data **typ**e.
27
+ - `usr`: Which **Us**e**r** is it from. Represented in the `Usernames` format below.
28
+ - `rid`: Record Key. Use this to access data from bsky api.
29
+
30
+ The most basic root construct will typically contain:
31
+
32
+ ```json
33
+ {
34
+ "typ": "<Type>",
35
+ "usr": {
36
+ "did": "did:plc:ssd5xwqvrdrxyu2br7sfjwzy",
37
+ "nms": "samera1989.bsky.social"
38
+ },
39
+ }
40
+ ```
41
+
42
  Usernames are constructed in the following format:
43
+
44
  ```json
45
  {
46
+ "did": "did:plc:4hqjfn7m6n5hno3doamuhgef",
47
+ "nms": "yui.syui.ai"
48
  }
49
  ```
50
 
51
+ `did`: `Decentralized ID`. Consider this as `ID` for most cases and it points to a unique ID.
52
+ `uns`: `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.
53
 
54
+ For most cases, expect these 2 fields to describe a user.
55
+
56
+ ### Blobs
57
+
58
+ Blobs represent media content. Typically you can tell it's a blob if it has a `mime` field and a `cid`.
59
+
60
+ ```json
61
+ {
62
+ "mime": "image/jpeg",
63
+ "size": 891965,
64
+ "cid": "bafkreifu35fvx45eyldhpoyb3zgtb5dobvjfpw5kkeexwxefrfpzye2pji"
65
+ }
66
+ ```
67
+
68
+ Given the user account is this:
69
+ ```json
70
+ {
71
+ "typ": "account",
72
+ "usr": {
73
+ "did": "did:plc:lri5xcv6ogaldxkigm32wa57",
74
+ "nms": "yukichiroyuchi.bsky.social",
75
+ "avy": {
76
+ "mime": "image/jpeg",
77
+ "size": 226086,
78
+ "cid": "bafkreif3z2y2rfrfcjt4rwwps4ib7q7qywrdt76bw6dmj5ebqefgllpima"
79
+ },
80
+ "bnr": null,
81
+ "crt": 1723726663.57,
82
+ "dsc": "――あなたの日常に、AIの籠った音色を。\n\n▼思い出や日常、希望をお聞かせください。その想いを曲にいたします。\nhttps://forms.gle/rF2iqwXxabfVEifd7",
83
+ "dsp": "雪白ゆっち feat.AI Creator"
84
+ }
85
+ }
86
+ ```
87
+
88
+ Construct the avy url like so:
89
+
90
+ Template: `https://bsky.social/xrpc/com.atproto.sync.getBlob?did=<usr.did>&cid=<usr.avy.cid>`
91
+
92
+ A full link looks like this: `https://bsky.social/xrpc/com.atproto.sync.getBlob?did=did:plc:lri5xcv6ogaldxkigm32wa57&cid=bafkreif3z2y2rfrfcjt4rwwps4ib7q7qywrdt76bw6dmj5ebqefgllpima`
93
+
94
+ Yes I did spend a while trying to lookup to see why it is not working.
95
 
96
+ ### Posts (Simple)
97
 
98
+ Posts can get rather complicated. Here's a sample of a simple post.
99
+
100
+ ```json
101
+ {
102
+ "typ": "post",
103
+ "usr": {
104
+ "did": "did:plc:ssd5xwqvrdrxyu2br7sfjwzy",
105
+ "nms": "samera1989.bsky.social"
106
+ },
107
+ "rid": "3kzyon77od52v",
108
+ "chg": "create",
109
+ "tst": 1723987630.494,
110
+ "pst": {
111
+ "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.👀👀",
112
+ "emb": null,
113
+ "fct": [],
114
+ "lbl": [],
115
+ "lng": [],
116
+ "tgs": [],
117
+ "rpl": null
118
+ }
119
+ }
120
+ ```
121
+
122
+ - `tst`: Contains the timestamp in unix float time.
123
+ - `chg`: Change type. Typically either `create` or `delete` for posts. `change` for allowing Direct Messages.
124
+ - `rid`: Record Key. Use this to access data from bsky api.
125
+ - `pst`: Contains the actual posted data.
126
+
127
+ ### Posts (Complex)
128
+
129
+ As for replies and other fields, here's a more complex example.
130
+
131
+ ```json
132
+ {
133
+ "typ": "reply",
134
+ "usr": {
135
+ "did": "did:plc:4hqjfn7m6n5hno3doamuhgef",
136
+ "nms": "yui.syui.ai"
137
+ },
138
+ "rid": "3kzyotm2hzq2d",
139
+ "chg": "create",
140
+ "tst": 1723987844.937,
141
+ "pst": {
142
+ "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",
143
+ "emb": null,
144
+ "fct": [
145
+ {
146
+ "typ": "@",
147
+ "val": "https://card.syui.ai/baiser",
148
+ "rng": [
149
+ 0,
150
+ 27
151
+ ]
152
+ }
153
+ ],
154
+ "lbl": [],
155
+ "lng": [],
156
+ "tgs": [],
157
+ "rpl": {
158
+ "typ": "post",
159
+ "usr": {
160
+ "did": "did:plc:vok247eewjmbmo3kxaizct2i",
161
+ "nms": "baiser.blue"
162
+ },
163
+ "rid": "3kzyotbooo22c",
164
+ "rrt": {
165
+ "typ": "post",
166
+ "usr": {
167
+ "did": "did:plc:vok247eewjmbmo3kxaizct2i",
168
+ "nms": "baiser.blue"
169
+ },
170
+ "rid": "3kzyosf6atg2v"
171
+ }
172
+ }
173
+ }
174
+ }
175
+ ```
176
+
177
+ `fct`: Stands for Facets:
178
+ - `typ`: The facet type. (`tag`,`link`,`mention`)
179
+ - `val`: The facet value. Note that this can be a `Username` dict when `typ` == `mention`
180
+ - `rng`: Byte range. AFAIK this is in UTF-16 but I can be wrong. Follow atproto's docs for this.
181
+ `lbl`: Labels. A list of strings. Though typically empty list for firehose streams. Labels are sent seperately firehose stream-wise.
182
+ `lng`: Languages. Either an list (Can be empty) or a string.
183
+ `tgs`: "Additional hashtags, in addition to any included in post text and facets."
184
+ `rpl`: The post that the current post is replying to.
185
+ - *Note:* The reply post is not enriched with the actual post.
186
+ - `typ`/`usr`/`rid`: [Refer to the simple posts section.](#posts-simple)
187
+ - `rrt`: Root post. Can be `null` if root post is the same as the `rpl` post `rid`.
188
+
189
+ ### Accounts
190
+
191
+ ```json
192
+ {
193
+ "typ": "account",
194
+ "usr": {
195
+ "did": "did:plc:cj3ngde5wbljf5sh33g7zsdz",
196
+ "nms": "shirotsu.bsky.social",
197
+ "avy": {
198
+ "mime": "image/jpeg",
199
+ "size": 79776,
200
+ "cid": "bafkreiczz2spptgturm43r33impbkcar4tmdmnh34pqkp2tynlztbxmw7a"
201
+ },
202
+ "bnr": {
203
+ "mime": "image/jpeg",
204
+ "size": 748930,
205
+ "cid": "bafkreigb5l3u32quxzhpbca6bnrunfdau3m4bp6fdntmj2lwec3erkssty"
206
+ },
207
+ "crt": null,
208
+ "dsc": "こっちでは、主に練習中の下手なイラスト・ゲーム関系とかを投稿していきたいな〜\n\n最推しのねくろさんの配信を見るといやされる( ◠‿◠ )",
209
+ "dsp": "しろっつ🖤🐐👑"
210
+ }
211
+ }
212
+ ```
213
+
214
+ For Accounts, the `usr` field is more filled. In addition to `did` and `nms`, there are other fields like:
215
+
216
+ - `avy`/`bnr`: either a `Blob` or null. Refer to [Blobs](#blobs) section above.
217
+ - `crt`: Account Creation time. Can be null!
218
+ - `dsc`: Profile Bio / Blurb Section.
219
+ - `dsp`: Display name.
220
+
221
+ ### Reconstructing to a AtUri
222
+
223
+ For `post` and `reply` types, Take the following values and combine them into the following url:
224
+
225
+ `at://<usr.did>/app.bsky.feed.post/<rid>`
226
+
227
+ Replies are just posts.
228
+
229
+ For `repost` and `like` types, it's similar but a bit different:
230
+
231
+ - Reposts: `at://<usr.did>/app.bsky.feed.repost/<rid>`
232
+ - likes: `at://<usr.did>/app.bsky.feed.like/<rid>`
233
+
234
+ ### Enrichment of replies
235
+
236
+ ```
237
+ curl -L -X GET 'https://public.api.bsky.app/xrpc/app.bsky.feed.getPosts?uris=at://did:plc:4hqjfn7m6n5hno3doamuhgef/app.bsky.feed.post/3kzyotm2hzq2d' \
238
+ -H 'Accept: application/json' \
239
+ -H 'Authorization: Bearer <TOKEN>'
240
+ ```
241
+
242
+ ### Illegal Spec Followers
243
+
244
+ In other words, we also capture content that failed to follow specs. Like this:
245
+
246
+ ```json
247
+ {
248
+ "typ": "IllegalSpecFollowerAkaFixYourShit",
249
+ "record": {
250
+ "text": "任某(男,31歲),被行拘! ",
251
+ "$type": "app.bsky.feed.post",
252
+ "embed": {
253
+ "uri": "https://www.headline01.com/a/Xio3zSUuGvX7J1jCSG_F5g-51479340.html",
254
+ "$type": "app.bsky.embed.external#main",
255
+ "external": {
256
+ "uri": "https://www.headline01.com/a/Xio3zSUuGvX7J1jCSG_F5g-51479340.html",
257
+ "thumb": {
258
+ "ref": "bafkreidrfrfluqo26yy4pemkcpgug2p5sea3xrwh3schfnns5owa7gbwvm",
259
+ "size": 86924,
260
+ "$type": "blob",
261
+ "mimeType": "image/jpeg"
262
+ },
263
+ "title": "任某(男,31歲),被行拘!",
264
+ "description": ""
265
+ }
266
+ },
267
+ "createdAt": "2024-08-18T14:05:19.645644Z"
268
+ }
269
+ }
270
+ ```
271
+
272
+ Lines marked as `IllegalSpecFollowerAkaFixYourShit` should be ignored in general though. Content isn't great anyway.
273
+
274
+ ## Various Notes
275
 
276
  ### Recommendations
277
 
 
281
 
282
  Do consider reading up on bsky docs and atproto docs.
283
 
284
+ ### Docs Nonsense
285
+
286
+ When the bluesky docs say: "...Implemented by PDS".
287
+
288
+ You should probably use the following base url: `https://bsky.social/xrpc/`
289
+
290
  ### Deletions
291
 
292
  UnActions ("unpost","unlike","unrepost") only contains `rid` as the record key.
293
 
294
  ### License
295
 
296
+ 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`.
297
 
298
+ 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.
299
 
300
  ### Citations
301
 
302
+ We would much love academia to cite this dataset. Be nice please `:)`
303
 
304
+ ```tex
305
  @misc{bskyaozora,
306
  title = {Aozora Diving: diving into the sea of atproto and bluesky network },
307
  author = {KaraKaraWitch},
308
  year = {2023},
309
  howpublished = {\url{https://huggingface.co/datasets/WitchesSocialStream/bluesky-Aozora-Diving}},
310
  }
311
+ ```