about summary refs log tree commit diff
path: root/app/views/api
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-30 23:01:03 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-30 23:01:03 +0100
commit6ff93845d55eb34fc8beceb0c2dde06860c1eb47 (patch)
tree4097796e3dc6daf8678c44473ba7611e025b618c /app/views/api
parent14bd46946d25186044485aa101dd2da976b61181 (diff)
Add basic OEmbed provider API, fix #247
Diffstat (limited to 'app/views/api')
-rw-r--r--app/views/api/oembed/show.json.rabl14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/views/api/oembed/show.json.rabl b/app/views/api/oembed/show.json.rabl
new file mode 100644
index 000000000..e035bc13c
--- /dev/null
+++ b/app/views/api/oembed/show.json.rabl
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+object @stream_entry
+
+node(:type) { 'rich' }
+node(:version) { '1.0' }
+node(:title, &:title)
+node(:author_name) { |entry| entry.account.display_name.blank? ? entry.account.username : entry.account.display_name }
+node(:author_url) { |entry| account_url(entry.account) }
+node(:provider_name) { Rails.configuration.x.local_domain }
+node(:provider_url) { root_url }
+node(:cache_age) { 86_400 }
+node(:html, &:content)
+node(:width) { @width }
+node(:height) { @height }