Skip to content

Instantly share code, notes, and snippets.

@saul-mtz
Created April 7, 2020 23:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saul-mtz/42545168e0630f623173ba1fccf4a044 to your computer and use it in GitHub Desktop.
Save saul-mtz/42545168e0630f623173ba1fccf4a044 to your computer and use it in GitHub Desktop.
// Algoritmo Snowflake para generación de tweet ids: https://developer.twitter.com/en/docs/basics/twitter-ids
// Módulo usado para obtener la fecha: https://www.npmjs.com/package/twitter-snowflake-to-date
const { twitterSnowflakeToDate } = require('twitter-snowflake-to-date');
// tweet original https://twitter.com/aracelibs/status/1246957335718662144
const fechaTweetOriginal = twitterSnowflakeToDate("1246957335718662144");
// supuesta respuesta: https://twitter.com/fgrmexico/status/1246957081585999872
const fechaRespuesta = twitterSnowflakeToDate("1246957081585999872");
// fecha del original
console.log(`${fechaTweetOriginal}`);
// fecha de la respuesta (1 min antes)
console.log(`${fechaRespuesta}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment