mastodon-timeline-widget/README.md
有限会社アゼット bc7c7f3903 Update README.md
2017-05-16 15:57:50 +09:00

60 lines
2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[English version](README_en.md)
# Mastodon.widgetについて
このJSで作られたウィジェットはあなたのホームページにマストドンのタイムラインを表示します。
## 要件
- jQuery
- ステータスに表示したいマストドンのインスタンスのアクセストークン
設定がしやすい用に、ウィザードを作りましたので、よろしければご利用下さい。
[Azet.jpのマストドンウィジェットウィザード](http://www.azet.jp/mastodon.wizard/wizard_jp.html)
## 設定
1) 必要なファイルをダウンロードをして下さい(CSSファイルとJSファイルは1つずつ).
2) 下記のコードをホームページに入れてください:
```html
<link rel="stylesheet" href="mastodon.widget.css">
<script type="text/javascript" src="mastodon.widget.js"></script>
<script>
$(document).ready(function() {
// jQUERY is required!
var mapi = new MastodonApi({
target_selector : '#myTimeline'
,instance_uri : '[マストドンのインスタンスURL]'
,access_token : '[アクセストークン]'
,account_id : '[ユーザのアカウントID]'
// optional parameters
//,toots_limit : 5
});
});
</script>
```
上記のサンプルコードに、下記の情報を正しく設定して下さい:
- [マストドンのインスタンスURL] => 例: https://mastodon.technology
- [アクセストークン] => マストドンのインスタンスのアクセストークン
- [ユーザのアカウントID] => タイムラインの表示したいユーザのID
3) タイムラインの為に、DIVのコンテナを追加して下さい
```html
<div id="myTimeline" class="mastodon-timeline mastodon-timeline-dark"></div>
```
## カスタマイズ
以下の2つのテーマが用意されております
- mastodon-timeline-light
- mastodon-timeline-dark
又は、オリジナルテーマ作成も可能です。詳しくはCSSファイルを参照下さい。