diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-07-15 15:11:29 -0400 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-07-15 15:11:29 -0400 |
commit | 6308539c1d669ad0b6072b48deeaa95969ebe318 (patch) | |
tree | 08e102d0bc3a66e5e0597a2db42498812fbdcc35 | |
parent | e637e5a8a97d5a30710046e70b1994007d65b939 (diff) |
Added oEmbed discovery for attachments and notices
-rw-r--r-- | actions/attachment.php | 22 | ||||
-rw-r--r-- | actions/shownotice.php | 14 |
2 files changed, 36 insertions, 0 deletions
diff --git a/actions/attachment.php b/actions/attachment.php index ee4cd9640..c9c416cb5 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'=>'laconica','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'=>'laconica','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..4cf226f1c 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'=>'laconica','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'=>'laconica','method'=>'oembed.xml'), + array('url'=>$this->notice->uri)), + 'title'=>'oEmbed'),null); } } |