summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/api.php1
-rw-r--r--actions/attachment.php22
-rw-r--r--actions/shownotice.php14
-rw-r--r--actions/twitapilaconica.php1
4 files changed, 38 insertions, 0 deletions
diff --git a/actions/api.php b/actions/api.php
index 452ed8e82..8b92889f8 100644
--- a/actions/api.php
+++ b/actions/api.php
@@ -129,6 +129,7 @@ class ApiAction extends Action
'laconica/config',
'laconica/wadl',
'tags/timeline',
+ 'oembed/oembed',
'groups/timeline');
static $bareauth = array('statuses/user_timeline',
diff --git a/actions/attachment.php b/actions/attachment.php
index ee4cd9640..c6a5d0d52 100644
--- a/actions/attachment.php
+++ b/actions/attachment.php
@@ -98,6 +98,28 @@ class AttachmentAction extends Action
return $a->title();
}
+ function extraHead()
+ {
+ $this->element('link',array('rel'=>'alternate',
+ 'type'=>'application/json+oembed',
+ 'href'=>common_local_url(
+ 'api',
+ array('apiaction'=>'oembed','method'=>'oembed.json'),
+ array('url'=>
+ common_local_url('attachment',
+ array('attachment' => $this->attachment->id)))),
+ 'title'=>'oEmbed'),null);
+ $this->element('link',array('rel'=>'alternate',
+ 'type'=>'text/xml+oembed',
+ 'href'=>common_local_url(
+ 'api',
+ array('apiaction'=>'oembed','method'=>'oembed.xml'),
+ array('url'=>
+ common_local_url('attachment',
+ array('attachment' => $this->attachment->id)))),
+ 'title'=>'oEmbed'),null);
+ }
+
/**
* Handle input
*
diff --git a/actions/shownotice.php b/actions/shownotice.php
index 1ec38a76b..8f73dc824 100644
--- a/actions/shownotice.php
+++ b/actions/shownotice.php
@@ -275,6 +275,20 @@ class ShownoticeAction extends OwnerDesignAction
$this->element('meta', array('name' => 'microid',
'content' => $id->toString()));
}
+ $this->element('link',array('rel'=>'alternate',
+ 'type'=>'application/json+oembed',
+ 'href'=>common_local_url(
+ 'api',
+ array('apiaction'=>'oembed','method'=>'oembed.json'),
+ array('url'=>$this->notice->uri)),
+ 'title'=>'oEmbed'),null);
+ $this->element('link',array('rel'=>'alternate',
+ 'type'=>'text/xml+oembed',
+ 'href'=>common_local_url(
+ 'api',
+ array('apiaction'=>'oembed','method'=>'oembed.xml'),
+ array('url'=>$this->notice->uri)),
+ 'title'=>'oEmbed'),null);
}
}
diff --git a/actions/twitapilaconica.php b/actions/twitapilaconica.php
index 8cd7a64b9..442fdbcef 100644
--- a/actions/twitapilaconica.php
+++ b/actions/twitapilaconica.php
@@ -171,4 +171,5 @@ class TwitapilaconicaAction extends TwitterapiAction
parent::handle($args);
$this->serverError(_('API method under construction.'), 501);
}
+
}