Mastodon
  • Mastodonの使い方
    • Signing up for an account
    • Setting up your profile
    • Posting toots
    • Using the network features
    • Dealing with unwanted content
    • Promoting yourself and others
    • Set your preferences
    • その他の設定
    • Using Mastodon externally
    • Moving or leaving accounts
  • Mastodonの構築
    • マシンの準備
    • ソースからインストール
    • 環境設定
    • オプションのインストール
      • 全文検索
      • 秘匿サービス
      • シングルサインオン
    • セットアップを完了する
    • 開発者向けコマンドラインを利用する
    • 新しいバージョンへアップグレード
    • サーバのバックアップ
    • 新しいマシンへの移行
    • サーバーのスケールアップ
    • モデレーション
    • トラブルシューティング
  • アプリケーションの開発
    • Getting started with the API
    • Playing with public data
    • Obtaining client app access
    • ログイン
    • ガイドラインとベストプラクティス
    • ライブラリ等
  • コントリビューション
    • 技術的情報
    • 開発環境のセットアップ
    • ソースコードの構造
    • ルーティング
  • スペック
    • ActivityPub
    • WebFinger
    • Security
    • Microformats
    • OAuth
  • REST API
    • OAuthスコープ
  • API一覧
    • apps
      • oauth
    • accounts
      • bookmarks
      • favourites
      • mutes
      • blocks
      • domain_blocks
      • filters
      • reports
      • follow_requests
      • endorsements
      • featured_tags
      • preferences
      • suggestions
    • statuses
      • media
      • polls
      • scheduled_statuses
      • streaming
    • timelines
      • conversations
      • lists
      • markers
    • notifications
      • push
    • search
    • instance
      • trends
      • directory
      • custom_emojis
    • admin
    • proofs
    • oembed
  • APIエンティティ
    • Account
    • Activity
    • Admin::Account
    • Admin::Report
    • Application
    • Attachment
    • Card
    • Context
    • Conversation
    • Emoji
    • Error
    • FeaturedTag
    • Field
    • Filter
    • History
    • IdentityProof
    • Instance
    • List
    • Marker
    • Mention
    • Notification
    • Poll
    • Preferences
    • PushSubscription
    • Relationship
    • Report
    • Results
    • ScheduledStatus
    • Source
    • Status
    • Tag
    • Token

Card

Represents a rich preview card that is generated using OpenGraph tags from a URL.

video

{
  "url": "https://www.youtube.com/watch?v=OMv_EPMED8Y",
  "title": "♪ Brand New Friend (Christmas Song!)",
  "description": "",
  "type": "video",
  "author_name": "YOGSCAST Lewis & Simon",
  "author_url": "https://www.youtube.com/user/BlueXephos",
  "provider_name": "YouTube",
  "provider_url": "https://www.youtube.com/",
  "html": "<iframe width=\"480\" height=\"270\" src=\"https://www.youtube.com/embed/OMv_EPMED8Y?feature=oembed\" frameborder=\"0\" allowfullscreen=\"\"></iframe>",
  "width": 480,
  "height": 270,
  "image": "https://files.mastodon.social/preview_cards/images/014/179/145/original/9cf4b7cf5567b569.jpeg",
  "embed_url": ""
}
photo
{
  "url": "https://www.flickr.com/photos/tomfenskephotography/49088768431/",
  "title": "Oregon",
  "description": "",
  "type": "photo",
  "author_name": "Tom Fenske Photography",
  "author_url": "https://www.flickr.com/photos/tomfenskephotography/",
  "provider_name": "Flickr",
  "provider_url": "https://www.flickr.com/",
  "html": "",
  "width": 1024,
  "height": 427,
  "image": "https://files.mastodon.social/preview_cards/images/014/287/139/original/651b1c6976817824.jpeg",
  "embed_url": "https://live.staticflickr.com/65535/49088768431_6a4322b3bb_b.jpg"
}
link
{
  "url": "https://www.theguardian.com/money/2019/dec/07/i-lost-my-193000-inheritance-with-one-wrong-digit-on-my-sort-code",
  "title": "‘I lost my £193,000 inheritance – with one wrong digit on my sort code’",
  "description": "When Peter Teich’s money went to another Barclays customer, the bank offered £25 as a token gesture",
  "type": "link",
  "author_name": "",
  "author_url": "",
  "provider_name": "",
  "provider_url": "",
  "html": "",
  "width": 0,
  "height": 0,
  "image": null,
  "embed_url": ""
}

Required attributes

url

Description: Location of linked resource.
Type: String (URL)
実装履歴: Added in 1.0.0

title

Description: Title of linked resource.
Type: String
実装履歴: Added in 1.0.0

description

Description: Description of preview.
Type: String
実装履歴: Added in 1.0.0

type

Description: The type of the preview card.
Type: String (Enumerable, oneOf)
link = Link OEmbed
photo = Photo OEmbed
video = Video OEmbed
rich = iframe OEmbed. Not currently accepted, so won’t show up in practice.
実装履歴: Added in 1.3.0

Optional attributes

author_name

Description: The author of the original resource.
Type: String
実装履歴: Added in 1.3.0

author_url

Description: A link to the author of the original resource.
Type: String (URL)
実装履歴: Added in 1.3.0

provider_name

Description: The provider of the original resource.
Type: String
実装履歴: Added in 1.3.0

provider_url

Description: A link to the provider of the original resource.
Type: String (URL)
実装履歴: Added in 1.3.0

html

Description: HTML to be used for generating the preview card.
Type: String (HTML)
実装履歴: Added in 1.3.0

width

Description: Width of preview, in pixels.
Type: Number
実装履歴: Added in 1.3.0

height

Description: Height of preview, in pixels.
Type: Number
実装履歴: Added in 1.3.0

image

Description: Preview thumbnail.
Type: String (URL)
実装履歴: Added in 1.0.0

embed_url

Description: Used for photo embeds, instead of custom html.
Type: String (URL)
実装履歴: Added in 2.1.0

See also

Status
app/serializers/rest/preview_card_serializer.rb

最終更新 May 17, 2020 · このページを改善する
他の言語: English

Merch

Tシャツとステッカー(英語)

Mastodonに参加しよう · ブログ · ·

ソースコード · CC BY-SA 4.0 · インプリント