Public
Edited
Mar 30, 2023
Insert cell
Insert cell
Insert cell
Insert cell
function extractTopics(value) {
const extract = value.post
const date = new Date(value.date)
let output = '<hr>'
output += "<div class='user'>" + value.user + "</div>"
if(value.profile != ""){
output += getUserCertification(value.profile) + "<br>"
}
output += '<a href="https://qbn.com/topics/' + value.id + '/" target="_blank" >'
output += date.toUTCString()
output += '</a>'
output += '<h2>' + value.title + '</h2>'
if(value.profile != ""){
output += "name: " + value.profile.name + "<br>"
output += "since: " + value.profile.since + "<br>"
output += "location: " + value.profile.location + "<br>"
output += "url: " + value.profile.url + "<br>"
}
output += '</p>'
if(value.profile != ""){
output += "<h3>Bio</h3>"
}else{
output += "<h3>Post</h3>"
}
output += extract
return output
}
Insert cell
// Returns user certification in readable string or empty string if not certified
function getUserCertification(profile){
if(profile.hasOwnProperty("rip")) return "<b>RIP " + profile.rip + "</b>"
if(profile.uncertified == "uncertified") return "<b>UNCERTIFIED</b>"
if(profile.uncertified == "certified") return "CERTIFIED by " + profile.by
if(profile.invited == "") return "BLUE USER"
if(profile.invited != "") return profile.invited + " by " + profile.by
}
Insert cell
newTopics = await getTopicsByDate(2)
Insert cell
newTopics
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
import {getTopicsByDate} from "be1c16dba078b46e"
Insert cell
html`
<style type="text/css">
img{
height:100%;
max-height:300px;
}
</style>`
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more