Skip to content

Instantly share code, notes, and snippets.

View rylandg's full-sized avatar

Ryland Goldstein rylandg

View GitHub Profile
@rylandg
rylandg / parser.js
Last active January 16, 2020 18:11
React parser
const parseOriginalTweet = (body) => {
const parser = new DOMParser();
const doc = parser.parseFromString(body, 'text/html');
return doc.querySelector('blockquote p').innerText || '';
}
const RenderedTweet = ({ tweet }) => {
const now = new Date();
const formattedTime = new Intl.DateTimeFormat(navigator.language, {
hour: 'numeric',