Closed mikelax closed 8 years ago
Here is an example JSON message object that should work to allow for unfurling of the youtube URL.
{
"response_type": "in_channel",
"text": "https://www.youtube.com/watch?v=XORui0wFKnE",
"attachments": [
{
"fallback": "The fallback text",
"title": "Discovery Spring",
"title_link": "http://apod.nasa.gov/apod/ap010320.html",
"text": "Here is the overview.",
"footer": "2016-09-26",
"color": "#0B3D91",
"callback_id": "apod",
"actions": [
{
"name": "favorite",
"text": "Save as Favorite",
"type": "button",
"value": "2016-09-26"
}
]
}
]
}
Completed in #19
Some dates for the NASA APOD function are videos. Currently the service assumes photos. It should be refactored to look at the
media_type
attribute and if its a value ofvideo
then render a video attachmentCommand to test with
/spacebot apod 2016-09-26
Corresponding NASA API: https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY&date=2016-09-26