mirror of
https://github.com/bellingcat/tiktok-timestamp.git
synced 2026-06-08 01:28:29 +03:00
Initial commit
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.DS_Store
|
||||
|
||||
71
index.html
Normal file
71
index.html
Normal file
@@ -0,0 +1,71 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Tiktok date extractor</title>
|
||||
<script src="https://unpkg.com/dayjs"></script>
|
||||
<script src="https://unpkg.com/dayjs-plugin-utc"></script>
|
||||
<script>
|
||||
dayjs.extend(dayjsPluginUTC.default);
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
margin: 1em;
|
||||
font-family: "Helvetica", Arial, sans-serif;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
button, input {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.form {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
function getdate() {
|
||||
document.getElementById("date").innerHTML = "...";
|
||||
document.getElementById("label").innerHTML = "Uploaded on: ";
|
||||
|
||||
var url = document.getElementById("url").value;
|
||||
|
||||
var headers = {
|
||||
Origin: "https://www.tiktok.com",
|
||||
Accept:
|
||||
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15",
|
||||
"Accept-Language": "en-us",
|
||||
Connection: "keep-alive",
|
||||
};
|
||||
|
||||
resp = fetch("https://cors-anywhere.herokuapp.com/" + url, {
|
||||
method: "GET",
|
||||
headers: headers,
|
||||
})
|
||||
.then(function (r) {
|
||||
return r.text();
|
||||
})
|
||||
.then(function (text) {
|
||||
var split = text.split(`"createTime":"`);
|
||||
split = split[1].split(`"`);
|
||||
|
||||
var formatted = dayjs
|
||||
.utc(+split[0] * 1000)
|
||||
.format("MMM D YYYY, HH:mm:ss UTC");
|
||||
|
||||
document.getElementById("date").innerHTML = formatted;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="form">
|
||||
<label for="url">Tiktok video URL:</label>
|
||||
<input type="text" id="url" name="url" />
|
||||
<button onclick="getdate()">Get uploaded date</button>
|
||||
</div>
|
||||
<div class="output"><span id="label">Uploaded on: </span><span class="date" id="date"></span></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user