Created
July 30, 2019 12:18
-
-
Save melvincarvalho/fbed989225780bb54ef466c99129dd83 to your computer and use it in GitHub Desktop.
add bookmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const user = 'https://melvincarvalho.com/#me'; | |
const time = new Date().toISOString(); | |
const title = document.title; | |
const recalls = location.href; | |
const ms = Math.floor(Math.random() * 1000); | |
const uri = time.substring(0,4) + time.substring(5,7) + time.substring(8,10) + time.substring(11,13) + time.substring(14,16) + time.substring (17,19) + "." + ms; | |
console.log(` | |
<> <http://purl.org/dc/terms/references> <#${uri}> .\n | |
\n | |
<#${uri}>\n | |
a <http://www.w3.org/2002/01/bookmark#Bookmark>;\n | |
<http://purl.org/dc/terms/created> "${time}"^^XML:dateTime;\n | |
<http://purl.org/dc/terms/title> "${title}";\n | |
<http://www.w3.org/2002/01/bookmark#recalls> <${recalls}>;\n | |
<http://xmlns.com/foaf/0.1/maker> <${user}> .\n | |
`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
const user = 'https://melvincarvalho.com/#me';
const time = new Date().toISOString();
const title = document.title;
const recalls = location.href;
const ms = Math.floor(Math.random() * 1000);
const uri = time.substring(0,4) + time.substring(5,7) + time.substring(8,10) + time.substring(11,13) + time.substring(14,16) + time.substring (17,19) + "." + ms;
console.log(`
<> http://purl.org/dc/terms/references <#${uri}> .\n
\n
<#${uri}> http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://www.w3.org/2002/01/bookmark#Bookmark .\n
<#${uri}> http://purl.org/dc/terms/created "${time}"^^http://www.w3.org/2001/XMLSchema#dateTime .\n
<#${uri}> http://purl.org/dc/terms/title "${title}" .\n
<#${uri}> http://www.w3.org/2002/01/bookmark#recalls <${recalls}> .\n
<#${uri}> http://xmlns.com/foaf/0.1/maker <${user}> .\n
`);