Skip to content

Commit

Permalink
feat: add last scraped
Browse files Browse the repository at this point in the history
  • Loading branch information
andylolz committed May 8, 2024
1 parent 94ca297 commit 0efa589
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions static/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
title: How it works
---

{% assign scraped_at = 'now' %}
{% assign updated_at = site.data.notes | map: "created_at" | sort | last %}

Community note data is fetched regularly [from Twitter](https://twitter.com/i/communitynotes/download-data).

This data is always a couple of days old (**the most recent data is from <time id="updatedAt" datetime="{{ updated_at }}" title="{{ updated_at | date_to_rfc822 }}">{{ updated_at }}</time>**).
This data is always a couple of days old (**most recent data is from <time class="dt" datetime="{{ updated_at }}" title="{{ updated_at | date_to_rfc822 }}">{{ updated_at }}</time>, scraped <time class="dt" datetime="{{ scraped_at }}" title="{{ scraped_at | date_to_rfc822 }}">{{ scraped_at | date_to_xmlschema }}</time>**).

Notes are excluded if they meet any of the following criteria:

Expand All @@ -15,7 +16,9 @@ Notes are excluded if they meet any of the following criteria:
* Currently rated ‘unhelpful’

<script>
const dt = document.getElementById('updatedAt');
const rel = luxon.DateTime.fromISO(dt.textContent).toRelative();
dt.textContent = rel;
const dts = document.getElementsByClassName('dt');
for (var i = 0; i < dts.length; i++) {
var dt = dts[i];
dt.textContent = luxon.DateTime.fromISO(dt.textContent).toRelative();
}
</script>

0 comments on commit 0efa589

Please sign in to comment.