2019-12-06 15:15:56 +01:00
|
|
|
import asyncdispatch, strutils, sequtils, uri, options
|
|
|
|
import jester
|
2020-06-01 02:22:56 +02:00
|
|
|
import ".."/[types, api], ../views/embed
|
2019-12-06 15:15:56 +01:00
|
|
|
|
|
|
|
export embed
|
|
|
|
|
|
|
|
proc createEmbedRouter*(cfg: Config) =
|
|
|
|
router embed:
|
|
|
|
get "/i/videos/tweet/@id":
|
2020-06-01 02:22:56 +02:00
|
|
|
let convo = await getTweet(@"id")
|
|
|
|
if convo == nil or convo.tweet == nil or convo.tweet.video.isNone:
|
|
|
|
resp Http404
|
|
|
|
|
|
|
|
resp renderVideoEmbed(cfg, convo.tweet)
|