Added codec of the attached file

This commit is contained in:
Arthur 2013-12-01 10:18:35 -05:00
parent 8325294e65
commit e8895b1752
2 changed files with 3 additions and 1 deletions

View File

@ -65,6 +65,7 @@ class YoutubeBridge extends BridgeAbstract{
$item->uri = 'https://www.youtube.com'.$element->find('a',0)->href;
$item->thumbnailUri = 'https:'.$element->find('img',0)->src;
$item->attachment = htmlspecialchars($video);
$item->attachmentCodec = "video/mp4";
$item->title = trim($element->find('h3',0)->plaintext);
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br><a href="' . $item->uri . '">' . $item->title . '</a>';
$this->items[] = $item;

View File

@ -26,6 +26,7 @@ class AtomFormat extends FormatAbstract{
$entryTitle = is_null($data->title) ? '' : $data->title;
$entryUri = is_null($data->uri) ? '' : $data->uri;
$entryAttachment = is_null($data->attachment) ? '' : $data->attachment;
$entryAttachmentCodec = is_null($data->attachmentCodec) ? '' : $data->attachmentCodec;
$entryTimestamp = is_null($data->timestamp) ? date(DATE_ATOM, 0) : date(DATE_ATOM, $data->timestamp);
$timestamps[] = (int)$entryTimestamp;
// We prevent content from closing the CDATA too early.
@ -43,7 +44,7 @@ class AtomFormat extends FormatAbstract{
<id>{$entryUri}</id>
<updated>{$entryTimestamp}</updated>
<content type="html">{$entryContent}</content>
<link rel="enclosure" href="{$entryAttachment}" />
<link rel="enclosure" href="{$entryAttachment}" type="{$entryAttachmentCodec}" />
</entry>
EOD;