1
0
card/public/book/1/ZGlkOnBsYzo0aHFqZm43bTZuNWhubzNkb2FtdWhnZWY/c1/1.html

629 lines
19 KiB
HTML
Raw Normal View History

2023-03-31 19:52:34 +00:00
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>quick start · hello world! bluesky</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="@gitbook-ng/gitbook 3.3.6">
<meta name="author" content="syui">
<link rel="stylesheet" href="../gitbook/style.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-codeblock-filename/block.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="2.html" />
<link rel="prev" href="./" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="../">
<a href="../">
hello world! bluesky
</a>
</li>
<li class="chapter " data-level="1.2" data-path="../card/">
<a href="../card/">
card
</a>
</li>
<li class="chapter " data-level="1.3" data-path="./">
<a href="./">
part 1
</a>
<ul class="articles">
<li class="chapter active" data-level="1.3.1" data-path="1.html">
<a href="1.html">
quick start
</a>
</li>
<li class="chapter " data-level="1.3.2" data-path="2.html">
<a href="2.html">
example
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" data-path="../c2/">
<a href="../c2/">
part 2
</a>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="../c2/1.html">
<a href="../c2/1.html">
bluesky
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="../c2/2.html">
<a href="../c2/2.html">
terminal
</a>
</li>
<li class="chapter " data-level="1.4.3" data-path="../c2/3.html">
<a href="../c2/3.html">
shell
</a>
</li>
<li class="chapter " data-level="1.4.4" data-path="../c2/4.html">
<a href="../c2/4.html">
rust
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" data-path="../c3/">
<a href="../c3/">
part 3
</a>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="../c3/1.html">
<a href="../c3/1.html">
hello world
</a>
</li>
<li class="chapter " data-level="1.5.2" data-path="../c3/2.html">
<a href="../c3/2.html">
seahorse
</a>
</li>
<li class="chapter " data-level="1.5.3" data-path="../c3/3.html">
<a href="../c3/3.html">
reqwest
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" data-path="../c4/">
<a href="../c4/">
part 4
</a>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="../c4/0.html">
<a href="../c4/0.html">
ai
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="../c4/1.html">
<a href="../c4/1.html">
config
</a>
</li>
<li class="chapter " data-level="1.6.3" data-path="../c4/2.html">
<a href="../c4/2.html">
mention
</a>
</li>
<li class="chapter " data-level="1.6.4" data-path="../c4/3.html">
<a href="../c4/3.html">
base64
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.7" data-path="../c5/">
<a href="../c5/">
part 5
</a>
<ul class="articles">
<li class="chapter " data-level="1.7.1" data-path="../c5/1.html">
<a href="../c5/1.html">
notify
</a>
</li>
<li class="chapter " data-level="1.7.2" data-path="../c5/2.html">
<a href="../c5/2.html">
timeline
</a>
</li>
<li class="chapter " data-level="1.7.3" data-path="../c5/3.html">
<a href="../c5/3.html">
refresh
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.8" data-path="../end/">
<a href="../end/">
end
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href=".." >quick start</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h3 id="&#x30AF;&#x30A4;&#x30C3;&#x30AF;&#x30B9;&#x30BF;&#x30FC;&#x30C8;">&#x30AF;&#x30A4;&#x30C3;&#x30AF;&#x30B9;&#x30BF;&#x30FC;&#x30C8;</h3>
<pre><code class="lang-sh">handle=yui.syui.ai
curl <span class="hljs-_">-s</span>L <span class="hljs-string">&quot;https://bsky.social/xrpc/com.atproto.repo.listRecords?repo=<span class="hljs-variable">${handle}</span>&amp;collection=app.bsky.feed.post&amp;limit=1&quot;</span>
</code></pre>
<p><a href="https://bsky.app/profile/did:plc:4hqjfn7m6n5hno3doamuhgef" target="_blank">@yui.syui.ai</a>&#x306B;&#x4EE5;&#x4E0B;&#x306E;<code>mention</code>&#x3092;&#x9001;&#x308A;&#x307E;&#x3059;&#x3002;</p>
<pre><code class="lang-sh">@yui.syui.ai /card egg
</code></pre>
<p>&#x3059;&#x308B;&#x3068;&#x3001;&#x30BF;&#x30DE;&#x30B4;&#x306E;&#x30AB;&#x30FC;&#x30C9;&#x304C;&#x3082;&#x3089;&#x3048;&#x307E;&#x3059;&#x3002;&#x3053;&#x306E;&#x96A0;&#x3057;&#x30B3;&#x30DE;&#x30F3;&#x30C9;&#x306F;&#x8AB0;&#x3067;&#x3082;&#x5B9F;&#x884C;&#x3067;&#x304D;&#x307E;&#x3059;&#x3002;&#x65E2;&#x306B;&#x6301;&#x3063;&#x3066;&#x3044;&#x308B;&#x4EBA;&#x306F;&#x305D;&#x306E;&#x65E8;&#x304C;&#x8868;&#x793A;&#x3055;&#x308C;&#x307E;&#x3059;&#x3002;</p>
<p>&#x3053;&#x306E;&#x30AB;&#x30FC;&#x30C9;&#x306F;&#x81EA;&#x5206;&#x306E;did&#x3092;<code>base64</code>&#x306B;&#x5909;&#x63DB;&#x3057;&#x3066;<code>@yui.syui.ai</code>&#x306B;&#x9001;&#x308B;&#x3053;&#x3068;&#x3068;&#x3067;&#x80B2;&#x6210;&#x3067;&#x304D;&#x308B;&#x3088;&#x3046;&#x306B;&#x306A;&#x3063;&#x3066;&#x3044;&#x307E;&#x3059;&#x3002;</p>
<pre><code class="lang-sh">$ <span class="hljs-built_in">echo</span> did:plc:4hqjfn7m6n5hno3doamuhgef|base64
ZGlkOnBsYzo0aHFqZm43bTZuNWhubzNkb2FtdWhnZWYK
</code></pre>
<pre><code class="lang-sh">@yui.syui.ai /egg ZGlkOnBsYzo0aHFqZm43bTZuNWhubzNkb2FtdWhnZWYK
</code></pre>
<p>1&#x65E5;&#x306E;&#x30D0;&#x30C8;&#x30EB;&#x30DD;&#x30A4;&#x30F3;&#x30C8;&#x3092;&#x6D88;&#x8CBB;&#x3059;&#x308B;&#x306E;&#x3067;&#x6CE8;&#x610F;&#x3057;&#x3066;&#x304F;&#x3060;&#x3055;&#x3044;&#x3002;</p>
<p>&#x3053;&#x308C;&#x3092;&#x30B3;&#x30DE;&#x30F3;&#x30C9;&#x3067;&#x9001;&#x308B;&#x5834;&#x5408;&#x306F;&#x4EE5;&#x4E0B;&#x306E;&#x3088;&#x3046;&#x306B;&#x306A;&#x308A;&#x307E;&#x3059;&#x3002;</p>
<div><p class="code-filename">env</p></div>
<pre><code class="lang-sh">data=`curl <span class="hljs-_">-s</span>L -X POST -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> <span class="hljs-_">-d</span> <span class="hljs-string">&quot;{\&quot;identifier\&quot;:\&quot;<span class="hljs-variable">$handle</span>\&quot;,\&quot;password\&quot;:\&quot;<span class="hljs-variable">$pass</span>\&quot;}&quot;</span> https://bsky.social/xrpc/com.atproto.server.createSession`
token=`<span class="hljs-built_in">echo</span> <span class="hljs-variable">$data</span>|jq -r .accessJwt`
did=`<span class="hljs-built_in">echo</span> <span class="hljs-variable">$data</span>|jq -r .did`
base=`<span class="hljs-built_in">echo</span> <span class="hljs-variable">$did</span>|base64`
handle_m=yui.syui.ai
did_m=`curl <span class="hljs-_">-s</span>L -X GET -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$token</span>&quot;</span> <span class="hljs-string">&quot;https://bsky.social/xrpc/app.bsky.actor.getProfile?actor=<span class="hljs-variable">${handle_m}</span>&quot;</span>|jq -r .did`
at=@<span class="hljs-variable">${handle_m}</span>
s=0
e=`<span class="hljs-built_in">echo</span> <span class="hljs-variable">$at</span>|wc -c`
text=<span class="hljs-string">&quot;<span class="hljs-variable">$at</span> /egg <span class="hljs-variable">$base</span>&quot;</span>
col=app.bsky.feed.post
created_at=`date --iso-8601=seconds`
</code></pre>
<div><p class="code-filename">json</p></div>
<pre><code class="lang-sh">json=<span class="hljs-string">&quot;{
\&quot;did\&quot;: \&quot;<span class="hljs-variable">$did</span>\&quot;,
\&quot;repo\&quot;: \&quot;<span class="hljs-variable">$handle</span>\&quot;,
\&quot;collection\&quot;: \&quot;<span class="hljs-variable">$col</span>\&quot;,
\&quot;record\&quot;: {
\&quot;text\&quot;: \&quot;<span class="hljs-variable">$text</span>\&quot;,
\&quot;\$type\&quot;: \&quot;<span class="hljs-variable">$col</span>\&quot;,
\&quot;createdAt\&quot;: \&quot;<span class="hljs-variable">$created_at</span>\&quot;,
\&quot;facets\&quot;: [
{
\&quot;\$type\&quot;: \&quot;app.bsky.richtext.facet\&quot;,
\&quot;index\&quot;: {
\&quot;byteEnd\&quot;: <span class="hljs-variable">$e</span>,
\&quot;byteStart\&quot;: <span class="hljs-variable">$s</span>
},\&quot;features\&quot;: [
{
\&quot;did\&quot;: \&quot;<span class="hljs-variable">$did_m</span>\&quot;,
\&quot;\$type\&quot;: \&quot;app.bsky.richtext.facet#mention\&quot;
}
]
}
]
}
}&quot;</span>
</code></pre>
<div><p class="code-filename">post</p></div>
<pre><code class="lang-sh">curl <span class="hljs-_">-s</span>L -X POST -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \
-H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$token</span>&quot;</span> \
<span class="hljs-_">-d</span> <span class="hljs-string">&quot;<span class="hljs-variable">$json</span>&quot;</span> \
https://bsky.social/xrpc/com.atproto.repo.createRecord
</code></pre>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="./" class="navigation navigation-prev " aria-label="Previous page: part 1">
<i class="fa fa-angle-left"></i>
</a>
<a href="2.html" class="navigation navigation-next " aria-label="Next page: example">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"quick start","level":"1.3.1","depth":2,"next":{"title":"example","level":"1.3.2","depth":2,"path":"c1/2.md","ref":"c1/2.md","articles":[]},"previous":{"title":"part 1","level":"1.3","depth":1,"path":"c1/README.md","ref":"c1/README.md","articles":[{"title":"quick start","level":"1.3.1","depth":2,"path":"c1/1.md","ref":"c1/1.md","articles":[]},{"title":"example","level":"1.3.2","depth":2,"path":"c1/2.md","ref":"c1/2.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["-sharing","codeblock-filename","mermaid-gb3","diff"],"root":"./","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"codeblock-filename":{},"mermaid-gb3":{},"diff":{"type":"markdown","method":"diffChars","options":{}},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"syui","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"hello world! bluesky","gitbook":"*","description":"This is a bluesky ai-card example, and first rust"},"file":{"path":"c1/1.md","mtime":"2023-07-22T11:07:11.734Z","type":"markdown"},"gitbook":{"version":"3.3.6","time":"2023-09-16T08:55:27.618Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
<script src="../gitbook/gitbook.js"></script>
<script src="../gitbook/theme.js"></script>
<script src="../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
<script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="../gitbook/gitbook-plugin-search/search.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
<script src="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>
</body>
</html>