Convert public directory from submodule to normal directory
- Remove public from git submodule tracking - Add all public directory contents as regular files - Fixes GitHub Actions error: "No url found for submodule path 'public' in .gitmodules" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,715 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="" >
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>notify · 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="../c1/">
|
||||
|
||||
<a href="../c1/">
|
||||
|
||||
|
||||
part 1
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../c1/1.html">
|
||||
|
||||
<a href="../c1/1.html">
|
||||
|
||||
|
||||
quick start
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../c1/2.html">
|
||||
|
||||
<a href="../c1/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="./">
|
||||
|
||||
<a href="./">
|
||||
|
||||
|
||||
part 5
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter active" data-level="1.7.1" data-path="1.html">
|
||||
|
||||
<a href="1.html">
|
||||
|
||||
|
||||
notify
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.7.2" data-path="2.html">
|
||||
|
||||
<a href="2.html">
|
||||
|
||||
|
||||
timeline
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.7.3" data-path="3.html">
|
||||
|
||||
<a href="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=".." >notify</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="notify">notify</h3>
|
||||
<p>ここまでたどり着いた人は、最初の<a href="../c1/1.html">クイックスタート</a>を開いてみてください。</p>
|
||||
<p>そこには<code>profile</code>と<code>notify</code>についてこのように記述されています。</p>
|
||||
<pre><code class="lang-sh"><span class="hljs-comment"># profile</span>
|
||||
curl <span class="hljs-_">-s</span>L -X GET -H <span class="hljs-string">"Content-Type: application/json"</span> \
|
||||
-H <span class="hljs-string">"Authorization: Bearer <span class="hljs-variable">$token</span>"</span> \
|
||||
<span class="hljs-string">"https://bsky.social/xrpc/app.bsky.actor.getProfile?actor=<span class="hljs-variable">${handle}</span>"</span>
|
||||
|
||||
<span class="hljs-comment"># notify</span>
|
||||
curl <span class="hljs-_">-s</span>L -X GET -H <span class="hljs-string">"Content-Type: application/json"</span> \
|
||||
-H <span class="hljs-string">"Authorization: Bearer <span class="hljs-variable">$token</span>"</span> \
|
||||
https://bsky.social/xrpc/app.bsky.notification.listNotifications
|
||||
</code></pre>
|
||||
<p>非常に似ていますね。</p>
|
||||
<p>まずは、先程作ったアプリの<code>profile</code>コマンドの使い方を紹介します。</p>
|
||||
<pre><code class="lang-sh">$ ./target/debug/ai p yui.syui.ai
|
||||
</code></pre>
|
||||
<p>調べたい<code>handle</code>を引数にすることで、プロフィールを取得するコマンドです。</p>
|
||||
<p>では、<code>profile</code>コマンドのコードの中身を見てみましょう。</p>
|
||||
<div><p class="code-filename">src/profile.rs</p></div>
|
||||
<pre><code class="lang-rust"><span class="hljs-keyword">extern</span> <span class="hljs-keyword">crate</span> reqwest;
|
||||
<span class="hljs-keyword">use</span> crate::token_toml;
|
||||
|
||||
<span class="hljs-keyword">pub</span> async <span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">get_request</span></span>(handle: <span class="hljs-built_in">String</span>) -> <span class="hljs-built_in">String</span> {
|
||||
|
||||
<span class="hljs-keyword">let</span> token = token_toml(&<span class="hljs-string">"access"</span>);
|
||||
<span class="hljs-keyword">let</span> url = <span class="hljs-string">"https://bsky.social/xrpc/app.bsky.actor.getProfile"</span>.to_owned() + &<span class="hljs-string">"?actor="</span> + &handle;
|
||||
<span class="hljs-keyword">let</span> client = reqwest::Client::new();
|
||||
<span class="hljs-keyword">let</span> res = client
|
||||
.get(url)
|
||||
.header(<span class="hljs-string">"Authorization"</span>, <span class="hljs-string">"Bearer "</span>.to_owned() + &token)
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.text()
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
<span class="hljs-keyword">return</span> res
|
||||
}
|
||||
</code></pre>
|
||||
<p>例えば、これを<code>notify</code>を取得するurlに変更すると、<code>notify</code>コマンドに変化します。以下のように書き換えてみてください。</p>
|
||||
<div><p class="code-filename">src/profile.rs</p></div>
|
||||
<pre><code class="lang-rust"><span class="hljs-keyword">extern</span> <span class="hljs-keyword">crate</span> reqwest;
|
||||
<span class="hljs-keyword">use</span> crate::token_toml;
|
||||
|
||||
<span class="hljs-keyword">pub</span> async <span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">get_request</span></span>(handle: <span class="hljs-built_in">String</span>) -> <span class="hljs-built_in">String</span> {
|
||||
|
||||
<span class="hljs-keyword">let</span> token = token_toml(&<span class="hljs-string">"access"</span>);
|
||||
<span class="hljs-comment">//let url = "https://bsky.social/xrpc/app.bsky.actor.getProfile".to_owned() + &"?actor=" + &handle;</span>
|
||||
<span class="hljs-keyword">let</span> url = <span class="hljs-string">"https://bsky.social/xrpc/app.bsky.notification.listNotifications"</span>;
|
||||
<span class="hljs-keyword">let</span> client = reqwest::Client::new();
|
||||
<span class="hljs-keyword">let</span> res = client
|
||||
.get(url)
|
||||
.header(<span class="hljs-string">"Authorization"</span>, <span class="hljs-string">"Bearer "</span>.to_owned() + &token)
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.text()
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
<span class="hljs-keyword">return</span> res
|
||||
}
|
||||
</code></pre>
|
||||
<p>これを<code>build</code>して実行してみましょう。</p>
|
||||
<pre><code class="lang-sh">$ cargo build
|
||||
$ ./target/debug/ai p yui.syui.ai
|
||||
</code></pre>
|
||||
<p>コマンド結果が通知の取得に変化しています。</p>
|
||||
<p>ただし、引数である<code>yui.syui.ai</code>は全く関係ありません。引数がなんでも通ります。</p>
|
||||
<p>ですが、この<code>src/profile.rs</code>を引用する<code>src/main.rs</code>側のコードが引数を必要とするため、これを省略すると動かなくなってしまうのです。</p>
|
||||
<div><p class="code-filename">src/main.rs</p></div>
|
||||
<pre><code class="lang-rust"><span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">profile</span></span>(c: &Context) {
|
||||
<span class="hljs-comment">// ここで引数を取得している</span>
|
||||
<span class="hljs-keyword">let</span> m = c.args[<span class="hljs-number">0</span>].to_string();
|
||||
<span class="hljs-keyword">let</span> h = async {
|
||||
<span class="hljs-comment">// 先程のコードはhandleを欲しがるため、ここで引数を取得した"m"を入れている</span>
|
||||
<span class="hljs-keyword">let</span> <span class="hljs-keyword">str</span> = profile::get_request(m.to_string()).await;
|
||||
<span class="hljs-built_in">println!</span>(<span class="hljs-string">"{}"</span>,<span class="hljs-keyword">str</span>);
|
||||
};
|
||||
<span class="hljs-keyword">let</span> res = tokio::runtime::Runtime::new().unwrap().block_on(h);
|
||||
<span class="hljs-keyword">return</span> res
|
||||
}
|
||||
</code></pre>
|
||||
<p>逆に言うと、<code>src/profile.rs</code>をコピーして一部を削除することで、新たに通知コマンドを作れるということです。</p>
|
||||
<p>新しく<code>notify</code>コマンドを作成してみましょう。</p>
|
||||
<pre><code class="lang-sh">$ cp src/profile.rs src/notify.rs
|
||||
</code></pre>
|
||||
<div><p class="code-filename">src/notify.rs</p></div>
|
||||
<pre><code class="lang-rust"><span class="hljs-keyword">extern</span> <span class="hljs-keyword">crate</span> reqwest;
|
||||
<span class="hljs-keyword">use</span> crate::token_toml;
|
||||
|
||||
<span class="hljs-keyword">pub</span> async <span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">get_request</span></span>() -> <span class="hljs-built_in">String</span> {
|
||||
|
||||
<span class="hljs-keyword">let</span> token = token_toml(&<span class="hljs-string">"access"</span>);
|
||||
<span class="hljs-keyword">let</span> url = <span class="hljs-string">"https://bsky.social/xrpc/app.bsky.notification.listNotifications"</span>;
|
||||
<span class="hljs-keyword">let</span> client = reqwest::Client::new();
|
||||
<span class="hljs-keyword">let</span> res = client
|
||||
.get(url)
|
||||
.header(<span class="hljs-string">"Authorization"</span>, <span class="hljs-string">"Bearer "</span>.to_owned() + &token)
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.text()
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
<span class="hljs-keyword">return</span> res
|
||||
}
|
||||
</code></pre>
|
||||
<div><p class="code-filename">src/main.rs</p></div>
|
||||
<pre><code class="lang-rust"><span class="hljs-comment">// 適切な場所に以下のコードを追加</span>
|
||||
|
||||
<span class="hljs-comment">// code:1</span>
|
||||
<span class="hljs-keyword">pub</span> <span class="hljs-keyword">mod</span> profile;
|
||||
|
||||
|
||||
<span class="hljs-comment">// code:2</span>
|
||||
.command(
|
||||
Command::new(<span class="hljs-string">"notify"</span>)
|
||||
.alias(<span class="hljs-string">"n"</span>)
|
||||
.action(c_notify),
|
||||
)
|
||||
|
||||
<span class="hljs-comment">// code:3</span>
|
||||
<span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">notify</span></span>() {
|
||||
<span class="hljs-keyword">let</span> h = async {
|
||||
<span class="hljs-keyword">let</span> <span class="hljs-keyword">str</span> = notify::get_request().await;
|
||||
<span class="hljs-built_in">println!</span>(<span class="hljs-string">"{}"</span>,<span class="hljs-keyword">str</span>);
|
||||
};
|
||||
<span class="hljs-keyword">let</span> res = tokio::runtime::Runtime::new().unwrap().block_on(h);
|
||||
<span class="hljs-keyword">return</span> res
|
||||
}
|
||||
<span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">c_notify</span></span>(_c: &Context) {
|
||||
access_token().unwrap();
|
||||
notify();
|
||||
}
|
||||
</code></pre>
|
||||
<p>これを<code>build</code>して実行してみます。</p>
|
||||
<pre><code class="lang-sh">$ cargo build
|
||||
$ ./target/debug/ai n
|
||||
</code></pre>
|
||||
<p>新しいコマンドの追加ができました。</p>
|
||||
<p><code>timeline</code>の取得も似たような感じです。是非、チャレンジしてみてください。</p>
|
||||
<div><p class="code-filename">src/timeline.rs</p></div>
|
||||
<pre><code class="lang-rust"><span class="hljs-comment">// timeline</span>
|
||||
<span class="hljs-comment">// https://github.com/bluesky-social/atproto/blob/main/lexicons/app/bsky/feed/getTimeline.json</span>
|
||||
<span class="hljs-keyword">let</span> url = <span class="hljs-string">"https://bsky.social/xrpc/app.bsky.feed.getTimeline"</span>;
|
||||
</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 5">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="2.html" class="navigation navigation-next " aria-label="Next page: timeline">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"notify","level":"1.7.1","depth":2,"next":{"title":"timeline","level":"1.7.2","depth":2,"path":"c5/2.md","ref":"c5/2.md","articles":[]},"previous":{"title":"part 5","level":"1.7","depth":1,"path":"c5/README.md","ref":"c5/README.md","articles":[{"title":"notify","level":"1.7.1","depth":2,"path":"c5/1.md","ref":"c5/1.md","articles":[]},{"title":"timeline","level":"1.7.2","depth":2,"path":"c5/2.md","ref":"c5/2.md","articles":[]},{"title":"refresh","level":"1.7.3","depth":2,"path":"c5/3.md","ref":"c5/3.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":"c5/1.md","mtime":"2023-08-15T16:16:51.214Z","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>
|
||||
|
@@ -0,0 +1,658 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="" >
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>timeline · 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="3.html" />
|
||||
|
||||
|
||||
<link rel="prev" href="1.html" />
|
||||
|
||||
|
||||
</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="../c1/">
|
||||
|
||||
<a href="../c1/">
|
||||
|
||||
|
||||
part 1
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../c1/1.html">
|
||||
|
||||
<a href="../c1/1.html">
|
||||
|
||||
|
||||
quick start
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../c1/2.html">
|
||||
|
||||
<a href="../c1/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="./">
|
||||
|
||||
<a href="./">
|
||||
|
||||
|
||||
part 5
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.7.1" data-path="1.html">
|
||||
|
||||
<a href="1.html">
|
||||
|
||||
|
||||
notify
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter active" data-level="1.7.2" data-path="2.html">
|
||||
|
||||
<a href="2.html">
|
||||
|
||||
|
||||
timeline
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.7.3" data-path="3.html">
|
||||
|
||||
<a href="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=".." >timeline</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="timeline">timeline</h3>
|
||||
<p><code>timeline</code>コマンドの追加はできましたか。</p>
|
||||
<p>ここでは追加できた前提で話をします。</p>
|
||||
<p>今のままではすごく見づらいですよね。これを形成して表示する必要が出てきます。</p>
|
||||
<p>今回は、出力結果を形成する方法の紹介です。</p>
|
||||
<div><p class="code-filename">src/data.rs</p></div>
|
||||
<pre><code class="lang-rust"><span class="hljs-meta">#[derive(Serialize, Deserialize)]</span>
|
||||
<span class="hljs-keyword">pub</span> <span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">Timeline</span></span> {
|
||||
<span class="hljs-keyword">pub</span> feed: <span class="hljs-built_in">Vec</span><Feed>
|
||||
}
|
||||
|
||||
<span class="hljs-meta">#[derive(Serialize, Deserialize)]</span>
|
||||
<span class="hljs-meta">#[allow(non_snake_case)]</span>
|
||||
<span class="hljs-keyword">pub</span> <span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">Feed</span></span> {
|
||||
<span class="hljs-keyword">pub</span> post: Post,
|
||||
}
|
||||
|
||||
<span class="hljs-meta">#[derive(Serialize, Deserialize)]</span>
|
||||
<span class="hljs-meta">#[allow(non_snake_case)]</span>
|
||||
<span class="hljs-keyword">pub</span> <span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">Post</span></span> {
|
||||
<span class="hljs-keyword">pub</span> did: <span class="hljs-built_in">Option</span><<span class="hljs-built_in">String</span>>,
|
||||
<span class="hljs-keyword">pub</span> uri: <span class="hljs-built_in">String</span>,
|
||||
<span class="hljs-keyword">pub</span> cid: <span class="hljs-built_in">String</span>,
|
||||
<span class="hljs-keyword">pub</span> collection: <span class="hljs-built_in">Option</span><<span class="hljs-built_in">String</span>>,
|
||||
<span class="hljs-keyword">pub</span> record: Record,
|
||||
<span class="hljs-keyword">pub</span> author: Author,
|
||||
<span class="hljs-keyword">pub</span> reason: <span class="hljs-built_in">Option</span><<span class="hljs-built_in">String</span>>,
|
||||
<span class="hljs-keyword">pub</span> indexedAt: <span class="hljs-built_in">String</span>,
|
||||
<span class="hljs-keyword">pub</span> replyCount: <span class="hljs-keyword">i32</span>,
|
||||
<span class="hljs-keyword">pub</span> postCount: <span class="hljs-built_in">Option</span><<span class="hljs-keyword">i32</span>>,
|
||||
<span class="hljs-keyword">pub</span> repostCount: <span class="hljs-keyword">i32</span>,
|
||||
<span class="hljs-keyword">pub</span> likeCount: <span class="hljs-keyword">i32</span>,
|
||||
}
|
||||
|
||||
<span class="hljs-meta">#[derive(Serialize, Deserialize)]</span>
|
||||
<span class="hljs-meta">#[allow(non_snake_case)]</span>
|
||||
<span class="hljs-keyword">pub</span> <span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">Record</span></span> {
|
||||
<span class="hljs-keyword">pub</span> text: <span class="hljs-built_in">Option</span><<span class="hljs-built_in">String</span>>,
|
||||
<span class="hljs-keyword">pub</span> createdAt: <span class="hljs-built_in">String</span>,
|
||||
}
|
||||
|
||||
<span class="hljs-meta">#[derive(Serialize, Deserialize)]</span>
|
||||
<span class="hljs-meta">#[allow(non_snake_case)]</span>
|
||||
<span class="hljs-keyword">pub</span> <span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">Author</span></span> {
|
||||
<span class="hljs-keyword">pub</span> did: <span class="hljs-built_in">String</span>,
|
||||
<span class="hljs-comment">//pub declaration: Declaration,</span>
|
||||
<span class="hljs-keyword">pub</span> description: <span class="hljs-built_in">Option</span><<span class="hljs-built_in">String</span>>,
|
||||
<span class="hljs-keyword">pub</span> displayName: <span class="hljs-built_in">Option</span><<span class="hljs-built_in">String</span>>,
|
||||
<span class="hljs-keyword">pub</span> handle: <span class="hljs-built_in">String</span>,
|
||||
<span class="hljs-keyword">pub</span> avatar: <span class="hljs-built_in">Option</span><<span class="hljs-built_in">String</span>>,
|
||||
<span class="hljs-keyword">pub</span> viewer: Viewer,
|
||||
<span class="hljs-keyword">pub</span> labels: Labels,
|
||||
}
|
||||
</code></pre>
|
||||
<p>rustで最も厄介なのが<code>struct</code>と呼ばれるデータ構造体を用意しなければならないことです。これは出力結果や<code>openapi</code>からコードを自動生成できますが、今回は手動で書いています。</p>
|
||||
<div><p class="code-filename">src/main.rs</p></div>
|
||||
<pre><code class="lang-rust"><span class="hljs-keyword">use</span> crate::data::Timeline;
|
||||
|
||||
<span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">timeline</span></span>() {
|
||||
<span class="hljs-keyword">let</span> h = async {
|
||||
<span class="hljs-keyword">let</span> j = timeline::get_request().await;
|
||||
<span class="hljs-keyword">let</span> timeline: Timeline = serde_json::from_str(&j).unwrap();
|
||||
<span class="hljs-keyword">let</span> n = timeline.feed;
|
||||
<span class="hljs-keyword">let</span> length = &n.len();
|
||||
<span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-number">0</span>..*length {
|
||||
<span class="hljs-built_in">println!</span>(<span class="hljs-string">"@{}"</span>, n[i].post.author.handle);
|
||||
<span class="hljs-keyword">if</span> ! n[i].post.record.text.is_none() {
|
||||
<span class="hljs-built_in">println!</span>(<span class="hljs-string">"{}"</span>, n[i].post.record.text.as_ref().unwrap());
|
||||
}
|
||||
<span class="hljs-comment">//println!("uri : {}", n[i].post.uri);</span>
|
||||
<span class="hljs-comment">//println!("cid : {}", n[i].post.cid);</span>
|
||||
<span class="hljs-built_in">println!</span>(<span class="hljs-string">"⚡️ [{}]\t🌈 [{}]\t⭐️ [{}]"</span>, n[i].post.replyCount,n[i].post.repostCount, n[i].post.likeCount);
|
||||
<span class="hljs-built_in">println!</span>(<span class="hljs-string">"{}"</span>, <span class="hljs-string">"---------"</span>);
|
||||
}
|
||||
};
|
||||
<span class="hljs-keyword">let</span> res = tokio::runtime::Runtime::new().unwrap().block_on(h);
|
||||
<span class="hljs-keyword">return</span> res
|
||||
}
|
||||
|
||||
<span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">c_timeline</span></span>(_c: &Context) {
|
||||
access_token().unwrap();
|
||||
timeline();
|
||||
}
|
||||
</code></pre>
|
||||
<p>できました。これで見やすいように出力結果が形成されます。</p>
|
||||
<pre><code class="lang-sh">$ cargo build
|
||||
|
||||
$ ./target/debug/ai t
|
||||
@yui.syui.ai
|
||||
hello world
|
||||
⚡️ [1] 🌈 [1] ⭐️ [0]
|
||||
---------
|
||||
</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="1.html" class="navigation navigation-prev " aria-label="Previous page: notify">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="3.html" class="navigation navigation-next " aria-label="Next page: refresh">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"timeline","level":"1.7.2","depth":2,"next":{"title":"refresh","level":"1.7.3","depth":2,"path":"c5/3.md","ref":"c5/3.md","articles":[]},"previous":{"title":"notify","level":"1.7.1","depth":2,"path":"c5/1.md","ref":"c5/1.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":"c5/2.md","mtime":"2023-08-15T18:19:00.371Z","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>
|
||||
|
@@ -0,0 +1,606 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="" >
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>refresh · 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="../end/" />
|
||||
|
||||
|
||||
<link rel="prev" href="2.html" />
|
||||
|
||||
|
||||
</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="../c1/">
|
||||
|
||||
<a href="../c1/">
|
||||
|
||||
|
||||
part 1
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../c1/1.html">
|
||||
|
||||
<a href="../c1/1.html">
|
||||
|
||||
|
||||
quick start
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../c1/2.html">
|
||||
|
||||
<a href="../c1/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="./">
|
||||
|
||||
<a href="./">
|
||||
|
||||
|
||||
part 5
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.7.1" data-path="1.html">
|
||||
|
||||
<a href="1.html">
|
||||
|
||||
|
||||
notify
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.7.2" data-path="2.html">
|
||||
|
||||
<a href="2.html">
|
||||
|
||||
|
||||
timeline
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter active" data-level="1.7.3" data-path="3.html">
|
||||
|
||||
<a href="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=".." >refresh</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="refresh">refresh</h3>
|
||||
<p>今までは<code>createSession</code>で都度、tokenを取得し、新しいsessionを作成してきました。</p>
|
||||
<p>これらsessionは2時間有効で、apiを呼び出すたびにsessionを作成していると有効なsessionがいくつもできてしまいます。</p>
|
||||
<p>そして、それぞれが2時間後に無効になります。</p>
|
||||
<p>これを回避する方法としては、<code>refreshSession</code>があります。<code>refresh-token</code>とも呼ばれます。</p>
|
||||
<p>基本的には、<code>https://bsky.social/xrpc/com.atproto.server.refreshSession</code>にtokenとして<code>refreshJwt</code>を指定するだけです。</p>
|
||||
<pre><code class="lang-sh">$ cat ~/.config/atr/token.json|jq -r .refreshJwt
|
||||
$ refresh=`cat ~/.config/atr/token.json|jq -r .refreshJwt`
|
||||
$ curl <span class="hljs-_">-s</span>L -X POST -H <span class="hljs-string">"Content-Type: application/json"</span> -H <span class="hljs-string">"Authorization: Bearer <span class="hljs-variable">$refresh</span>"</span> https://bsky.social/xrpc/com.atproto.server.refreshSession
|
||||
</code></pre>
|
||||
<p>これを保存しておけば、約2ヶ月有効だそうです。</p>
|
||||
<p>これを<code>rust</code>で書いてみると、こんな感じになります。</p>
|
||||
<div><p class="code-filename">src/refresh.rs</p></div>
|
||||
<pre><code class="lang-rust"><span class="hljs-keyword">extern</span> <span class="hljs-keyword">crate</span> reqwest;
|
||||
<span class="hljs-keyword">use</span> crate::token_toml;
|
||||
<span class="hljs-keyword">use</span> crate::url;
|
||||
<span class="hljs-keyword">use</span> serde_json::json;
|
||||
|
||||
<span class="hljs-keyword">pub</span> async <span class="hljs-function"><span class="hljs-keyword">fn</span> <span class="hljs-title">post_request</span></span>() -> <span class="hljs-built_in">String</span> {
|
||||
|
||||
<span class="hljs-keyword">let</span> access = token_toml(&<span class="hljs-string">"access"</span>);
|
||||
<span class="hljs-keyword">let</span> refresh = token_toml(&<span class="hljs-string">"refresh"</span>);
|
||||
<span class="hljs-keyword">let</span> did = token_toml(&<span class="hljs-string">"did"</span>);
|
||||
<span class="hljs-keyword">let</span> handle = token_toml(&<span class="hljs-string">"handle"</span>);
|
||||
|
||||
<span class="hljs-keyword">let</span> url = url(&<span class="hljs-string">"session_refresh"</span>);
|
||||
|
||||
<span class="hljs-keyword">let</span> client = reqwest::Client::new();
|
||||
<span class="hljs-keyword">let</span> res = client
|
||||
.post(url)
|
||||
.header(<span class="hljs-string">"Authorization"</span>, <span class="hljs-string">"Bearer "</span>.to_owned() + &refresh)
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.text()
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
<span class="hljs-keyword">return</span> res
|
||||
}
|
||||
</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="2.html" class="navigation navigation-prev " aria-label="Previous page: timeline">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="../end/" class="navigation navigation-next " aria-label="Next page: end">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"refresh","level":"1.7.3","depth":2,"next":{"title":"end","level":"1.8","depth":1,"path":"end/README.md","ref":"end/README.md","articles":[]},"previous":{"title":"timeline","level":"1.7.2","depth":2,"path":"c5/2.md","ref":"c5/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":"c5/3.md","mtime":"2023-09-16T08:54:12.238Z","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>
|
||||
|
@@ -0,0 +1,567 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="" >
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||
<title>part 5 · 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="1.html" />
|
||||
|
||||
|
||||
<link rel="prev" href="../c4/3.html" />
|
||||
|
||||
|
||||
</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="../c1/">
|
||||
|
||||
<a href="../c1/">
|
||||
|
||||
|
||||
part 1
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.3.1" data-path="../c1/1.html">
|
||||
|
||||
<a href="../c1/1.html">
|
||||
|
||||
|
||||
quick start
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.3.2" data-path="../c1/2.html">
|
||||
|
||||
<a href="../c1/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 active" data-level="1.7" data-path="./">
|
||||
|
||||
<a href="./">
|
||||
|
||||
|
||||
part 5
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<ul class="articles">
|
||||
|
||||
|
||||
<li class="chapter " data-level="1.7.1" data-path="1.html">
|
||||
|
||||
<a href="1.html">
|
||||
|
||||
|
||||
notify
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.7.2" data-path="2.html">
|
||||
|
||||
<a href="2.html">
|
||||
|
||||
|
||||
timeline
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class="chapter " data-level="1.7.3" data-path="3.html">
|
||||
|
||||
<a href="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=".." >part 5</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">
|
||||
|
||||
<h2 id="part-5">part 5</h2>
|
||||
<p>この章ではコマンドの追加や応用を考えます。</p>
|
||||
|
||||
|
||||
</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="../c4/3.html" class="navigation navigation-prev " aria-label="Previous page: base64">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="1.html" class="navigation navigation-next " aria-label="Next page: notify">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"part 5","level":"1.7","depth":1,"next":{"title":"notify","level":"1.7.1","depth":2,"path":"c5/1.md","ref":"c5/1.md","articles":[]},"previous":{"title":"base64","level":"1.6.4","depth":2,"path":"c4/3.md","ref":"c4/3.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":"c5/README.md","mtime":"2023-08-15T15:16:40.108Z","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>
|
||||
|
Reference in New Issue
Block a user