Skip to content

Commit

Permalink
Merge pull request #3188 from davidkassa/develop
Browse files Browse the repository at this point in the history
Promote Develop
  • Loading branch information
davidkassa authored Jan 12, 2025
2 parents 4e51c5f + 9fb91ae commit f01f32f
Show file tree
Hide file tree
Showing 8 changed files with 7,579 additions and 6,151 deletions.
130 changes: 60 additions & 70 deletions functions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.17.0",
"@types/cheerio": "^0.22.35",
"@types/node": "^22.10.3",
"@typescript-eslint/eslint-plugin": "^8.19.0",
"@typescript-eslint/parser": "^8.19.0",
"@types/node": "^22.10.5",
"@typescript-eslint/eslint-plugin": "^8.19.1",
"@typescript-eslint/parser": "^8.19.1",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
Expand All @@ -35,7 +35,7 @@
"eslint-plugin-unicorn": "^56.0.1",
"firebase-functions-test": "^3.4.0",
"globals": "^15.14.0",
"typescript": "^5.7.2"
"typescript": "^5.7.3"
},
"engines": {
"node": "20"
Expand Down
13 changes: 6 additions & 7 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ import { Meta } from "./meta";
// const firestore = admin.firestore();

// Replace with this
import { initializeApp } from 'firebase-admin/app';
import { getFirestore } from 'firebase-admin/firestore';
import { initializeApp } from "firebase-admin/app";
import { getFirestore } from "firebase-admin/firestore";

initializeApp();
const firestore = getFirestore();


const runtimeOpts = {
timeoutSeconds: 300,
};
Expand Down Expand Up @@ -174,17 +173,17 @@ const parseEditDateFromHtml = (
// timeNode = $(hash + " .messageMeta .DateTime");
// let timeNode = $(hash + " .editDate .DateTime");
let timeNode = $(parentSelector + " " + childEditDateSelector);
let epoch = timeNode.attr("data-time"); // "epoch";
if (!epoch) {
let epoch = timeNode.attr("data-timestamp"); // "epoch";
if (!epoch || !moment.unix(epoch).isValid()) {
const editStr = timeNode.attr("title"); // format: Apr 3, 2018 at 1:51 PM
if (editStr) {
epoch = moment(editStr, "MMM D, YYYY at h:mm A").unix().toString();
}
}
if (!epoch) {
timeNode = $(parentSelector + " " + childPostDateSelector);
epoch = timeNode.attr("data-time"); // "epoch";
if (!epoch) {
epoch = timeNode.attr("data-timestamp"); // "epoch";
if (!epoch || !moment.unix(epoch).isValid()) {
const dateStr = timeNode.attr("title"); // format: Apr 3, 2018 at 1:51 PM
if (dateStr) {
epoch = moment(dateStr, "MMM D, YYYY at h:mm A").unix().toString();
Expand Down
Loading

0 comments on commit f01f32f

Please sign in to comment.