Skip to content

Commit

Permalink
env stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Nawafds committed Dec 6, 2023
1 parent 636403a commit 2a4ab13
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,4 @@ cloud_functions/functions/scripts/JSON_data/naacpdata.json
cloud_functions/functions/scripts/JSON_data/new_naacp.json
cloud_functions/functions/config.js
MongoDB/src/JSON_data/census.json
rssfeed/.env
31 changes: 31 additions & 0 deletions rssfeed/package-lock.json

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

2 changes: 2 additions & 0 deletions rssfeed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"axios": "^1.6.2",
"cheerio": "^1.0.0-rc.12",
"crypto": "^1.0.1",
"dotenv": "^16.3.1",
"env": "^0.0.2",
"jquery": "^3.7.1",
"js-sha256": "^0.10.1",
"mongodb": "^6.3.0",
Expand Down
10 changes: 6 additions & 4 deletions rssfeed/rss_feed_simple_version.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
const axios = require("axios");
const cheerio = require("cheerio");
const cron = require("node-cron");
require("dotenv").config();

const papa = require("papaparse");
const sha256 = require("js-sha256");

const { MongoClient } = require("mongodb");

const mongoUrl =
"mongodb://mongo:[email protected]:6703";
const mongoUrl = process.env.REACT_SCRAPPER_MONGO;
const proxy_Url = process.env.REACT_APP_ML_PIP_URL;

console.log(mongoUrl);
const dbName = "se_naacp_db";
const proxy_Url = "https://ml-service-toswle5frq-ue.a.run.app/upload_csv";

async function get_links() {
const client = new MongoClient(mongoUrl);
Expand Down Expand Up @@ -173,7 +175,7 @@ function logMessage() {
console.log("Cron job executed at:", new Date().toLocaleString());
}

cron.schedule("* * * * *", async () => {
cron.schedule("20 * * * * *", async () => {
logMessage();
await main();
});

0 comments on commit 2a4ab13

Please sign in to comment.