TiddlyWikiPharo/repository/TiddlyWiki/WebVideo.extension.st

24 lines
561 B
Smalltalk

Extension { #name : #WebVideo }
{ #category : #'*TiddlyWiki' }
WebVideo >> asTiddler [
| tiddler body |
tiddler := Tiddler new
title: self title.
tiddler customFields
at: 'uid' put: self videoId;
at: 'author' put: self author;
at: 'authorId' put: self authorId;
at: 'duration' put: self duration.
body := '' writeStream.
body
nextPutAll: '<<richlink "https://www.youtube.com/watch?v=', self videoId ,'">>';
nextPutAll: '
* ''''Duración:'''' {{!!duration}}
* ''''Autor/a:'''' {{!!author}}'.
tiddler text: body contents.
^ tiddler
]